I've realized that the current SVN version of PrestaShop is not sorting correctly product attributes. To correct this you can do the following changes on your source code:
(obviously, you don't have to include «[INI] Infordesign» and «[END] Infordesign» comments, they're on the code I posted just to indicate were the changes have been done.)
NOTE: The idea of hiding "01.", "02.", ... from the Attribute name was from «vinoalvino» user, from this forum, as posted here: http://www.prestasho...iewthread/3139/
FILE: /classes/Product.php
TODO: Change «getAttributesGroups» to this:
public function getAttributesGroups($id_lang)
{
$result = Db::getInstance()->ExecuteS('
SELECT ag.`id_attribute_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, a.`id_attribute`, al.`name` AS attribute_name,
a.`color` AS attribute_color, pa.`id_product_attribute`, pa.`quantity`, pa.`price`, pa.`ecotax`, pa.`weight`, pa.`default_on`, pa.`reference`
FROM `'._DB_PREFIX_.'product_attribute` pa
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute`
LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute`
LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group`
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON a.`id_attribute` = al.`id_attribute`
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON ag.`id_attribute_group` = agl.`id_attribute_group`
WHERE pa.`id_product` = '.intval($this->id).'
AND al.`id_lang` = '.intval($id_lang).'
AND agl.`id_lang` = '.intval($id_lang).
// [INI] Infordesign
'ORDER BY agl.`name`, al.`name`, pa.`id_product_attribute`');
$resultsArray = array();
foreach ($result AS $row)
{
$row['attribute_name'] = preg_replace('/^[0-9]+./', '', $row['attribute_name']);
$resultsArray[] = $row;
}
return $resultsArray;
// [END] Infordesign
}



Vous parlez français ?









