Пример #1
0
 protected function addAttributeSetData(Ess_M2ePro_Model_Listing_Product $listingProduct, Ess_M2ePro_Model_Ebay_Template_Category $categoryTemplate, array &$requestData)
 {
     $requestData['attribute_set'] = array('attribute_set_id' => 0, 'attributes' => array());
     $filters = array('mode' => Ess_M2ePro_Model_Ebay_Template_Category_Specific::MODE_ATTRIBUTE_SET);
     $specifics = $categoryTemplate->getSpecifics(true, $filters);
     foreach ($specifics as $specific) {
         /** @var $specific Ess_M2ePro_Model_Ebay_Template_Category_Specific */
         $categoryTemplate->getMagentoProduct()->clearNotFoundAttributes();
         $tempAttributeData = $specific->getAttributeData();
         $tempAttributeValues = $specific->getValues();
         $notFoundAttributes = $categoryTemplate->getMagentoProduct()->getNotFoundAttributes();
         if (!empty($notFoundAttributes)) {
             Mage::getModel('M2ePro/Connector_Server_Ebay_Item_Helper')->addNotFoundAttributesMessage($listingProduct, Mage::helper('M2ePro')->__('Specifics'), $notFoundAttributes);
             continue;
         }
         $requestData['attribute_set']['attribute_set_id'] = $specific->getModeRelationId();
         $requestData['attribute_set']['attributes'][] = array('id' => $tempAttributeData['id'], 'value' => $tempAttributeValues);
     }
 }