示例#1
0
 protected function getLockIdentifier()
 {
     $identifier = parent::getLockIdentifier();
     if (!empty($this->params['remove'])) {
         $identifier .= '_and_remove';
     }
     return $identifier;
 }
 public function eventBeforeProcessing()
 {
     parent::eventBeforeProcessing();
     $skus = array();
     foreach ($this->listingsProducts as $listingProduct) {
         $skus[] = $this->getRequestDataObject($listingProduct)->getSku();
     }
     $this->addSkusToQueue($skus);
 }
 protected function getLockIdentifier()
 {
     if (!empty($this->params['switch_to'])) {
         $switchTo = $this->params['switch_to'];
         if ($switchTo === Ess_M2ePro_Model_Amazon_Listing_Product_Action_Request_Qty::FULFILLMENT_MODE_AFN) {
             return 'switch_to_afn';
         }
         if ($switchTo === Ess_M2ePro_Model_Amazon_Listing_Product_Action_Request_Qty::FULFILLMENT_MODE_MFN) {
             return 'switch_to_mfn';
         }
     }
     return parent::getLockIdentifier();
 }
 protected function filterLockedListingsProducts()
 {
     parent::filterLockedListingsProducts();
     if (empty($this->params['remove'])) {
         return;
     }
     foreach ($this->listingsProducts as $key => $listingProduct) {
         /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
         $amazonListingProduct = $listingProduct->getChildObject();
         if (!$amazonListingProduct->getVariationManager()->isRelationParentType()) {
             continue;
         }
         if (!$listingProduct->isLockedObject('child_products_in_action')) {
             continue;
         }
         // M2ePro_TRANSLATIONS
         // Another Action is being processed. Try again when the Action is completed.
         $this->getLogger()->logListingProductMessage($listingProduct, 'Stop and Remove action is not supported if Child Products are in Action.', Ess_M2ePro_Model_Log_Abstract::TYPE_ERROR, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
         unset($this->listingsProducts[$key]);
     }
 }
示例#5
0
 protected function setLocks($hash)
 {
     $skus = array();
     foreach ($this->listingsProducts as $listingProduct) {
         /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */
         $skus[] = $listingProduct->getData('sku');
     }
     $this->addSkusToQueue($skus);
     parent::setLocks($hash);
 }