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


PHP Ess_M2ePro_Model_Listing_Product::save方法代码示例

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


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

示例1: process

 public function process()
 {
     if (is_null($this->listingProduct)) {
         throw new Ess_M2ePro_Model_Exception('Listing Product was not set.');
     }
     $this->getTypeModel()->enableCache();
     foreach ($this->getSortedProcessors() as $processor) {
         $this->getProcessorModel($processor)->process();
     }
     $this->listingProduct->setData('variation_parent_need_processor', 0);
     $this->listingProduct->save();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:12,代码来源:Processor.php

示例2: setListAttemptData

 private function setListAttemptData(Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     $additionalData = $listingProduct->getAdditionalData();
     $additionalData['last_list_attempt_date'] = Mage::helper('M2ePro')->getCurrentGmtDate();
     $listingProduct->setSettings('additional_data', $additionalData);
     $listingProduct->save();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:7,代码来源:List.php

示例3: processAddedListingProduct

 protected function processAddedListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params)
 {
     if (!empty($params['template_category_id'])) {
         $listingProduct->setData('template_category_id', $params['template_category_id']);
     }
     if (!empty($params['template_other_category_id'])) {
         $listingProduct->setData('template_other_category_id', $params['template_other_category_id']);
     }
     $listingProduct->save();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:10,代码来源:Listing.php

示例4: processAddedListingProduct

 protected function processAddedListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params)
 {
     if (empty($params['template_description_id'])) {
         return;
     }
     /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
     $amazonListingProduct = $listingProduct->getChildObject();
     if (!$amazonListingProduct->getVariationManager()->isRelationParentType()) {
         $listingProduct->setData('template_description_id', $params['template_description_id']);
         $listingProduct->setData('is_general_id_owner', Ess_M2ePro_Model_Amazon_Listing_Product::IS_GENERAL_ID_OWNER_YES);
         $listingProduct->save();
         return;
     }
     $processor = $amazonListingProduct->getVariationManager()->getTypeModel()->getProcessor();
     if ($listingProduct->getMagentoProduct()->isBundleType() || $listingProduct->getMagentoProduct()->isSimpleTypeWithCustomOptions()) {
         $processor->process();
         return;
     }
     $detailsModel = Mage::getModel('M2ePro/Amazon_Marketplace_Details');
     $detailsModel->setMarketplaceId($listingProduct->getListing()->getMarketplaceId());
     /** @var Ess_M2ePro_Model_Template_Description $descriptionTemplate */
     $descriptionTemplate = Mage::helper('M2ePro/Component_Amazon')->getModel('Template_Description')->load($params['template_description_id']);
     /** @var Ess_M2ePro_Model_Amazon_Template_Description $amazonDescriptionTemplate */
     $amazonDescriptionTemplate = $descriptionTemplate->getChildObject();
     $possibleThemes = $detailsModel->getVariationThemes($amazonDescriptionTemplate->getProductDataNick());
     $productAttributes = $amazonListingProduct->getVariationManager()->getTypeModel()->getProductAttributes();
     foreach ($possibleThemes as $theme) {
         if (count($theme['attributes']) != count($productAttributes)) {
             continue;
         }
         $listingProduct->setData('template_description_id', $params['template_description_id']);
         $listingProduct->setData('is_general_id_owner', Ess_M2ePro_Model_Amazon_Listing_Product::IS_GENERAL_ID_OWNER_YES);
         break;
     }
     $listingProduct->save();
     $processor->process();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:37,代码来源:Listing.php

示例5: matchEmptyProductOptionsChild

 private function matchEmptyProductOptionsChild(Ess_M2ePro_Model_Listing_Product $listingProduct)
 {
     /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
     $amazonListingProduct = $listingProduct->getChildObject();
     /** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
     $typeModel = $amazonListingProduct->getVariationManager()->getTypeModel();
     $channelOptions = $typeModel->getChannelOptions();
     $productOptions = array_merge($this->getProcessor()->getTypeModel()->getNotRemovedUnusedProductOptions(), $this->getProcessor()->getTypeModel()->getUsedProductOptions(true));
     $matcher = $this->getOptionMatcher();
     $matcher->setDestinationOptions(array($amazonListingProduct->getGeneralId() => $channelOptions));
     foreach ($productOptions as $productOption) {
         $generalId = $matcher->getMatchedOptionGeneralId($productOption);
         if (is_null($generalId)) {
             continue;
         }
         $existChild = $this->findChildByProductOptions($productOption);
         if (!is_null($existChild)) {
             $this->getProcessor()->tryToDeleteChildListingProduct($existChild);
         }
         $productVariation = $this->getProcessor()->getProductVariation($productOption);
         if (empty($productVariation)) {
             continue;
         }
         $typeModel->setProductVariation($productVariation);
         $listingProduct->save();
         break;
     }
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:28,代码来源:Options.php


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