当前位置: 首页>>代码示例>>PHP>>正文


PHP Ess_M2ePro_Model_Listing_Product::getStatusChanger方法代码示例

本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getStatusChanger方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getStatusChanger方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getStatusChanger怎么用?PHP Ess_M2ePro_Model_Listing_Product::getStatusChanger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ess_M2ePro_Model_Listing_Product的用法示例。


在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getStatusChanger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isMeetRelistRequirements

 /**
  * @param Ess_M2ePro_Model_Listing_Product $listingProduct
  * @return bool
  * @throws Ess_M2ePro_Model_Exception
  * @throws Ess_M2ePro_Model_Exception_Logic
  */
 public function isMeetRelistRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     if (!$listingProduct->isStopped() || $listingProduct->isBlocked()) {
         return false;
     }
     if (!$listingProduct->isRelistable()) {
         return false;
     }
     /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
     $amazonListingProduct = $listingProduct->getChildObject();
     $variationManager = $amazonListingProduct->getVariationManager();
     if ($variationManager->isVariationProduct()) {
         if ($variationManager->isRelationParentType()) {
             return false;
         }
         if (!$variationManager->getTypeModel()->isVariationProductMatched()) {
             return false;
         }
     }
     $amazonSynchronizationTemplate = $amazonListingProduct->getAmazonSynchronizationTemplate();
     if (!$amazonSynchronizationTemplate->isRelistMode()) {
         return false;
     }
     if ($amazonSynchronizationTemplate->isRelistFilterUserLock() && $listingProduct->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
         return false;
     }
     if ($listingProduct->isLockedObject('in_action')) {
         return false;
     }
     $variationResource = Mage::getResourceModel('M2ePro/Listing_Product_Variation');
     if ($amazonSynchronizationTemplate->isRelistStatusEnabled()) {
         if (!$listingProduct->getMagentoProduct()->isStatusEnabled()) {
             return false;
         } else {
             if ($variationManager->isPhysicalUnit() && $variationManager->getTypeModel()->isVariationProductMatched()) {
                 $temp = $variationResource->isAllStatusesDisabled($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
                 if (!is_null($temp) && $temp) {
                     return false;
                 }
             }
         }
     }
     if ($amazonSynchronizationTemplate->isRelistIsInStock()) {
         if (!$listingProduct->getMagentoProduct()->isStockAvailability()) {
             return false;
         } else {
             if ($variationManager->isPhysicalUnit() && $variationManager->getTypeModel()->isVariationProductMatched()) {
                 $temp = $variationResource->isAllDoNotHaveStockAvailabilities($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
                 if (!is_null($temp) && $temp) {
                     return false;
                 }
             }
         }
     }
     if ($amazonSynchronizationTemplate->isRelistWhenQtyMagentoHasValue()) {
         $result = false;
         $productQty = (int) $amazonListingProduct->getQty(true);
         $typeQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyMagentoHasValueType();
         $minQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyMagentoHasValueMin();
         $maxQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyMagentoHasValueMax();
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
             $result = true;
         }
         if (!$result) {
             return false;
         }
     }
     if ($amazonSynchronizationTemplate->isRelistWhenQtyCalculatedHasValue()) {
         $result = false;
         $productQty = (int) $amazonListingProduct->getQty(false);
         $typeQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyCalculatedHasValueType();
         $minQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyCalculatedHasValueMin();
         $maxQty = (int) $amazonSynchronizationTemplate->getRelistWhenQtyCalculatedHasValueMax();
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Amazon_Template_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
             $result = true;
         }
         if (!$result) {
             return false;
         }
     }
     return true;
 }
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:100,代码来源:Inspector.php

示例2: isMeetRelistRequirements

 /**
  * @param Ess_M2ePro_Model_Listing_Product $listingProduct
  * @return bool
  * @throws Ess_M2ePro_Model_Exception_Logic
  */
 public function isMeetRelistRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     if ($listingProduct->isListed()) {
         return false;
     }
     if (!$listingProduct->isRelistable() && !$listingProduct->isHidden()) {
         return false;
     }
     /** @var Ess_M2ePro_Model_Ebay_Listing_Product $ebayListingProduct */
     $ebayListingProduct = $listingProduct->getChildObject();
     $ebaySynchronizationTemplate = $ebayListingProduct->getEbaySynchronizationTemplate();
     // Correct synchronization
     // ---------------------------------------
     if (!$ebaySynchronizationTemplate->isRelistMode()) {
         return false;
     }
     if ($listingProduct->isStopped() && $ebaySynchronizationTemplate->isRelistFilterUserLock() && $listingProduct->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
         return false;
     }
     if (!$ebayListingProduct->isSetCategoryTemplate()) {
         return false;
     }
     // ---------------------------------------
     $variationResource = Mage::getResourceModel('M2ePro/Listing_Product_Variation');
     // Check filters
     // ---------------------------------------
     if ($ebaySynchronizationTemplate->isRelistStatusEnabled()) {
         if (!$listingProduct->getMagentoProduct()->isStatusEnabled()) {
             return false;
         } else {
             if ($ebayListingProduct->isVariationsReady()) {
                 $temp = $variationResource->isAllStatusesDisabled($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
                 if (!is_null($temp) && $temp) {
                     return false;
                 }
             }
         }
     }
     if ($ebaySynchronizationTemplate->isRelistIsInStock()) {
         if (!$listingProduct->getMagentoProduct()->isStockAvailability()) {
             return false;
         } else {
             if ($ebayListingProduct->isVariationsReady()) {
                 $temp = $variationResource->isAllDoNotHaveStockAvailabilities($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
                 if (!is_null($temp) && $temp) {
                     return false;
                 }
             }
         }
     }
     if ($ebaySynchronizationTemplate->isRelistWhenQtyMagentoHasValue()) {
         $result = false;
         $productQty = (int) $listingProduct->getMagentoProduct()->getQty(true);
         $typeQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyMagentoHasValueType();
         $minQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyMagentoHasValueMin();
         $maxQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyMagentoHasValueMax();
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
             $result = true;
         }
         if (!$result) {
             return false;
         }
     }
     if ($ebaySynchronizationTemplate->isRelistWhenQtyCalculatedHasValue()) {
         $result = false;
         $productQty = (int) $ebayListingProduct->getQty();
         $typeQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyCalculatedHasValueType();
         $minQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyCalculatedHasValueMin();
         $maxQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyCalculatedHasValueMax();
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
             $result = true;
         }
         if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
             $result = true;
         }
         if (!$result) {
             return false;
         }
     }
     // ---------------------------------------
     return true;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:96,代码来源:Inspector.php


注:本文中的Ess_M2ePro_Model_Listing_Product::getStatusChanger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。