Exemplo n.º 1
0
 public static function prepareTitle($data)
 {
     $product = new Product($data['real_id_product'], false, $data['id_lang']);
     $features = Feature::getFeatures($data['id_lang']);
     $features_product = $product->getFrontFeatures($data['id_lang']);
     $tags = array('{TITLE}', '{BRAND}', '{REFERENCE}', '{EAN}');
     $values = array($data['name'], $data['manufacturer_name'], $data['reference'], $data['ean13']);
     foreach ($features as $feature) {
         $tags[] = trim(str_replace(' ', '_', Tools::strtoupper('{FEATURE_' . $feature['name'] . '}')));
         $hasFeature = array_map(array('EbayRequest', 'getValueOfFeature'), $features_product, $feature);
         if (isset($hasFeature[0]) && $hasFeature[0]) {
             $values[] = $hasFeature[0];
         } else {
             $values[] = '';
         }
     }
     return EbaySynchronizer::fillTemplateTitle($tags, $values, $data['titleTemplate']);
 }