rferrero Posted March 20, 2013 Share Posted March 20, 2013 (edited) Hola, Necesito que el modulo de busqueda de prestashop, busque por el campo ean13 tambien por los atributos de cada producto, Alguien sabe como modificar el modulo? Un saludo Edited March 20, 2013 by rferrero (see edit history) Link to comment Share on other sites More sharing options...
rferrero Posted March 20, 2013 Author Share Posted March 20, 2013 He solucionado esto añadiendo el ean13 en el nombre de la indexación de los atributos search.php, linea 349 public static function getAttributes($db, $id_product, $id_lang) { if (!Combination::isFeatureActive()) return ''; $attributes = ''; $attributesArray = $db->executeS(' SELECT al.name, pa.ean13 FROM '._DB_PREFIX_.'product_attribute pa INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.') '.Shop::addSqlAssociation('product_attribute', 'pa').' WHERE pa.id_product = '.(int)$id_product); foreach ($attributesArray as $attribute) $attributes .= $attribute['name'].' '.$attribute['ean13'].' '; return $attributes; } Link to comment Share on other sites More sharing options...
Sergio Ruiz Posted March 20, 2013 Share Posted March 20, 2013 He solucionado esto añadiendo el ean13 en el nombre de la indexación de los atributos search.php, linea 349 public static function getAttributes($db, $id_product, $id_lang) { if (!Combination::isFeatureActive()) return ''; $attributes = ''; $attributesArray = $db->executeS(' SELECT al.name, pa.ean13 FROM '._DB_PREFIX_.'product_attribute pa INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.') '.Shop::addSqlAssociation('product_attribute', 'pa').' WHERE pa.id_product = '.(int)$id_product); foreach ($attributesArray as $attribute) $attributes .= $attribute['name'].' '.$attribute['ean13'].' '; return $attributes; } ¿No seria mas correcto hacer un override depende modificar el fichero *.php directamente? Link to comment Share on other sites More sharing options...
Recommended Posts