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


PHP Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage方法代码示例

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


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

示例1: getRequestData

 public function getRequestData(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params = array())
 {
     if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
         return array();
     }
     if (!$listingProduct->getChildObject()->isListingTypeFixed()) {
         $listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: listing type "auction" does not support multi-variations.');
         return array();
     }
     if ($listingProduct->getChildObject()->getEbaySellingFormatTemplate()->isIgnoreVariationsEnabled()) {
         $listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: ignore variation option is enabled in selling format policy.');
         return array();
     }
     if (!$listingProduct->getChildObject()->getCategoryTemplate()->isVariationEnabled()) {
         $listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: eBay primary category allows to list only single items.');
         return array();
     }
     $requestData = array();
     // Get Request Variations Data
     //-----------------------------
     $productVariations = $listingProduct->getVariations(true);
     foreach ($productVariations as $variation) {
         /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
         $tempItem = array('price' => $variation->getChildObject()->getPrice(), 'qty' => $variation->getChildObject()->isDelete() ? 0 : $variation->getChildObject()->getQty(), 'sku' => $variation->getChildObject()->getSku(), 'specifics' => array());
         $tempParamKey = 'return_variation_has_sales_key_when_qty_is_zero';
         if (isset($params[$tempParamKey]) && $params[$tempParamKey] && $tempItem['qty'] <= 0) {
             $temp = $variation->getChildObject()->hasSales();
             $temp && ($tempItem['has_sales'] = $temp);
         }
         $productVariationsOptions = $variation->getOptions(true);
         foreach ($productVariationsOptions as $option) {
             /** @var $option Ess_M2ePro_Model_Listing_Product_Variation_Option */
             $tempItem['specifics'][$option->getAttribute()] = $option->getOption();
         }
         $requestData[] = $tempItem;
     }
     //-----------------------------
     return $requestData;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:39,代码来源:HelperVariations.php

示例2: addNotFoundAttributesMessage

 public function addNotFoundAttributesMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $optionTitle, array $attributesCodes)
 {
     $attributesTitles = array();
     foreach ($attributesCodes as $attributeCode) {
         $attributesTitles[] = Mage::helper('M2ePro/Magento_Attribute')->getAttributeLabel($attributeCode, $listingProduct->getListing()->getStoreId());
     }
     $message = Mage::helper('M2ePro')->__('%s: attribute(s) %s were not found in this product and its value was not sent.', $optionTitle, implode(',', $attributesTitles));
     $listingProduct->addAdditionalWarningMessage($message);
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:9,代码来源:Helper.php


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