本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
}