protected function isListingProductLocked() { $lockItem = $this->activeRecordFactory->getObject('LockItem'); $lockItem->setNick(\Ess\M2ePro\Helper\Component\Ebay::NICK . '_listing_product_' . $this->listingProduct->getId()); if ($this->listingProduct->isSetProcessingLock('in_action') || $lockItem->isExist()) { // M2ePro\TRANSLATIONS // Another Action is being processed. Try again when the Action is completed. $message = $this->modelFactory->getObject('Connector\\Connection\\Response\\Message'); $message->initFromPreparedData('Another Action is being processed. Try again when the Action is completed.', \Ess\M2ePro\Model\Connector\Connection\Response\Message::TYPE_ERROR); $this->getLogger()->logListingProductMessage($this->listingProduct, $message, \Ess\M2ePro\Model\Log\AbstractLog::PRIORITY_MEDIUM); return true; } return false; }
/** * @param \Ess\M2ePro\Model\Listing\Product $listingProduct * @return bool * @throws \Ess\M2ePro\Model\Exception * @throws \Ess\M2ePro\Model\Exception\Logic */ public function isMeetReviseGeneralRequirements(\Ess\M2ePro\Model\Listing\Product $listingProduct) { /** @var \Ess\M2ePro\Model\Amazon\Listing\Product $amazonListingProduct */ $amazonListingProduct = $listingProduct->getChildObject(); if (!$amazonListingProduct->isAfnChannel() && (!$listingProduct->isListed() || $listingProduct->isBlocked())) { return false; } if (!$listingProduct->isRevisable()) { return false; } $variationManager = $amazonListingProduct->getVariationManager(); if ($variationManager->isVariationProduct()) { if ($variationManager->isRelationParentType()) { return false; } if ($variationManager->isPhysicalUnit() && !$variationManager->getTypeModel()->isVariationProductMatched()) { return false; } } if ($listingProduct->isSetProcessingLock('in_action')) { return false; } return true; }
/** * @param \Ess\M2ePro\Model\Listing\Product $listingProduct * @return bool * @throws \Ess\M2ePro\Model\Exception\Logic */ public function isMeetReviseGeneralRequirements(\Ess\M2ePro\Model\Listing\Product $listingProduct) { if (!$listingProduct->isListed()) { return false; } if (!$listingProduct->isRevisable() || $listingProduct->isHidden()) { return false; } /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */ $ebayListingProduct = $listingProduct->getChildObject(); if (!$ebayListingProduct->isSetCategoryTemplate()) { return false; } if ($listingProduct->isSetProcessingLock('in_action')) { return false; } return true; }