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


PHP Ess_M2ePro_Model_Marketplace::getChildObject方法代码示例

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


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

示例1: addMotorsSpecificsData

 protected function addMotorsSpecificsData(Ess_M2ePro_Model_Listing_Product $listingProduct, Ess_M2ePro_Model_Marketplace $marketplace, Ess_M2ePro_Model_Ebay_Template_Category $categoryTemplate, array &$requestData)
 {
     if ($marketplace->getId() != Ess_M2ePro_Helper_Component_Ebay::MARKETPLACE_MOTORS) {
         return;
     }
     $categoryId = $categoryTemplate->getMainCategory();
     $categoryData = $marketplace->getChildObject()->getCategory($categoryId);
     $features = !empty($categoryData['features']) ? (array) json_decode($categoryData['features'], true) : array();
     $attributes = !empty($features['parts_compatibility_attributes']) ? $features['parts_compatibility_attributes'] : array();
     if (empty($attributes)) {
         return;
     }
     $categoryTemplate->getMagentoProduct()->clearNotFoundAttributes();
     $specifics = Mage::helper('M2ePro/Component_Ebay_MotorsSpecifics')->getSpecifics($listingProduct);
     if ($specifics === false) {
         return;
     }
     $notFoundAttributes = $categoryTemplate->getMagentoProduct()->getNotFoundAttributes();
     if (!empty($notFoundAttributes)) {
         Mage::getModel('M2ePro/Connector_Server_Ebay_Item_Helper')->addNotFoundAttributesMessage($listingProduct, Mage::helper('M2ePro')->__('Compatibility'), $notFoundAttributes);
         return;
     }
     $requestData['motors_specifics'] = array();
     foreach ($specifics as $specific) {
         $compatibilityList = array();
         $compatibilityData = $specific->getCompatibilityData();
         foreach ($compatibilityData as $key => $value) {
             if ($value == '--') {
                 unset($compatibilityData[$key]);
                 continue;
             }
             $name = $key;
             foreach ($attributes as $attribute) {
                 if ($attribute['title'] == $key) {
                     $name = $attribute['ebay_id'];
                     break;
                 }
             }
             $compatibilityList[] = array('name' => $name, 'value' => $value);
         }
         $requestData['motors_specifics'][] = $compatibilityList;
     }
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:43,代码来源:HelperCategory.php


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