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


PHP Ess_M2ePro_Model_Magento_Product::getProduct方法代码示例

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


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

示例1: getDescription

 private function getDescription(Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Listing_Product $listingProduct = NULL)
 {
     $descriptionTemplateData = $this->_getSession()->getTemplateData();
     $descriptionModeProduct = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_PRODUCT;
     $descriptionModeShort = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_SHORT;
     $descriptionModeCustom = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_CUSTOM;
     if ($descriptionTemplateData['description_mode'] == $descriptionModeProduct) {
         $description = $magentoProduct->getProduct()->getDescription();
     } elseif ($descriptionTemplateData['description_mode'] == $descriptionModeShort) {
         $description = $magentoProduct->getProduct()->getShortDescription();
     } elseif ($descriptionTemplateData['description_mode'] == $descriptionModeCustom) {
         $description = $descriptionTemplateData['description_template'];
     } else {
         $description = '';
     }
     if (empty($description)) {
         return $description;
     }
     $renderer = Mage::helper('M2ePro/Module_Renderer_Description');
     $description = $renderer->parseTemplate($description, $magentoProduct);
     if (!is_null($listingProduct)) {
         /** @var Ess_M2ePro_Model_Ebay_Listing_Product_Description_Renderer $renderer */
         $renderer = Mage::getSingleton('M2ePro/Ebay_Listing_Product_Description_Renderer');
         $renderer->setListingProduct($listingProduct->getChildObject());
         $description = $renderer->parseTemplate($description);
     }
     $this->addWatermarkInfoToDescriptionIfNeed($description);
     return $description;
 }
开发者ID:ppkowalski,项目名称:M2E,代码行数:29,代码来源:DescriptionController.php

示例2: insertAttributes

 private function insertAttributes($text, Ess_M2ePro_Model_Magento_Product $magentoProduct)
 {
     preg_match_all("/#([a-zA-Z_0-9]+?)#/", $text, $matches);
     if (!count($matches[0])) {
         return $text;
     }
     $search = array();
     $replace = array();
     foreach ($matches[1] as $attributeCode) {
         $value = $magentoProduct->getAttributeValue($attributeCode);
         if (!is_array($value) && $value != '') {
             if ($attributeCode == 'description') {
                 $value = $this->normalizeDescription($value);
             } elseif ($attributeCode == 'weight') {
                 $value = (double) $value;
             } elseif (in_array($attributeCode, array('price', 'special_price'))) {
                 $value = round($value, 2);
                 $storeId = $magentoProduct->getProduct()->getStoreId();
                 $store = Mage::app()->getStore($storeId);
                 $value = $store->formatPrice($value, false);
             }
             $search[] = '#' . $attributeCode . '#';
             $replace[] = $value;
         } else {
             $search[] = '#' . $attributeCode . '#';
             $replace[] = '';
         }
     }
     $text = str_replace($search, $replace, $text);
     return $text;
 }
开发者ID:aligent,项目名称:M2E,代码行数:31,代码来源:Description.php

示例3: getDescription

 private function getDescription($descriptionMode, $customDescription, Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Listing_Product $listingProduct = NULL)
 {
     $description = '';
     $descriptionModeProduct = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_PRODUCT;
     $descriptionModeShort = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_SHORT;
     $descriptionModeCustom = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_CUSTOM;
     if ($descriptionModeProduct == $descriptionMode) {
         $description = $magentoProduct->getProduct()->getDescription();
     } elseif ($descriptionModeShort == $descriptionMode) {
         $description = $magentoProduct->getProduct()->getShortDescription();
     } elseif ($descriptionModeCustom == $descriptionMode) {
         $description = $customDescription;
     }
     if (empty($description)) {
         return $description;
     }
     $renderer = Mage::helper('M2ePro/Module_Renderer_Description');
     $description = $renderer->parseTemplate($description, $magentoProduct);
     if (!is_null($listingProduct)) {
         /** @var Ess_M2ePro_Model_Ebay_Listing_Product_Description_Renderer $renderer */
         $renderer = Mage::getSingleton('M2ePro/Ebay_Listing_Product_Description_Renderer');
         $renderer->setListingProduct($listingProduct->getChildObject());
         $description = $renderer->parseTemplate($description);
     }
     return $description;
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:26,代码来源:DescriptionController.php


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