Exemplo n.º 1
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;
 }