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; } }