Exemplo n.º 1
0
 /**
  * @return Ess_M2ePro_Model_Magento_Product_Cache
  */
 public function getMagentoProduct()
 {
     if (!$this->magentoProductModel) {
         $this->magentoProductModel = Mage::getModel('M2ePro/Magento_Product_Cache')->setStoreId($this->getListing()->getStoreId())->setProductId($this->getData('product_id'));
     }
     $this->getListingProduct()->isCacheEnabled ? $this->magentoProductModel->enableCache() : $this->magentoProductModel->disableCache();
     return $this->magentoProductModel;
 }
Exemplo n.º 2
0
 protected function prepareMagentoProduct(Ess_M2ePro_Model_Magento_Product_Cache $instance)
 {
     $instance->setStoreId($this->getListing()->getStoreId());
     $instance->setStatisticId($this->getId());
     if (method_exists($this->getChildObject(), 'prepareMagentoProduct')) {
         $instance = $this->getChildObject()->prepareMagentoProduct($instance);
     }
     return $instance;
 }
Exemplo n.º 3
0
 /**
  * @param Ess_M2ePro_Model_Magento_Product_Cache $instance
  * @return Ess_M2ePro_Model_Magento_Product_Cache
  * @throws Ess_M2ePro_Model_Exception
  */
 public function prepareMagentoProduct(Ess_M2ePro_Model_Magento_Product_Cache $instance)
 {
     if (!$this->getVariationManager()->isRelationMode()) {
         return $instance;
     }
     /** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Parent $parentTypeModel */
     if ($this->getVariationManager()->isRelationParentType()) {
         $parentTypeModel = $this->getVariationManager()->getTypeModel();
     } else {
         $parentAmazonListingProduct = $this->getVariationManager()->getTypeModel()->getAmazonParentListingProduct();
         $parentTypeModel = $parentAmazonListingProduct->getVariationManager()->getTypeModel();
     }
     $instance->setVariationVirtualAttributes($parentTypeModel->getVirtualProductAttributes());
     $instance->setVariationFilterAttributes($parentTypeModel->getVirtualChannelAttributes());
     return $instance;
 }