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