retrospecter Posted July 17, 2008 Share Posted July 17, 2008 Good morning to everyone ¡¡¡ Would you be so kind to explain how could I order the attributes pull-down inside the product file module ? Be so kind to refer to the attached file. I would like to have it in the following way:· T-Shirt color· Drawing 1 color· Drawing 2 color· Size.I have tried to edit the name of the attributes , which appears on back office (not in the public name), placing before the name of the attribute some “aa”, “bb”, etc to follow the order: · aaT-Shirt color· bbDrawing 1 color· ccDrawing 2 color· ddSize.This does not work. I have also tries to order them as the categories method: · 1. T-Shirt color· 2. Drawing 1 color· 3. Drawing 2 color· 4. Size.But, this does not work ¡¡¡ What can I do to solve this problem? I hope someone could help me. Many thanks in advance, Best regards, Link to comment Share on other sites More sharing options...
ejectcore Posted July 17, 2008 Share Posted July 17, 2008 There are several ways to do what you request.first I will show you the easiest method.within product.php you will find the following line. (nothing must be changed here, but please take not the function being called is [n]getAttributesGroups[/b] $attributesGroups = $product->getAttributesGroups(intval($cookie->id_lang));You will find this function classes/product.php line 1317all you need to do is change the following line. use any of fields below you want to order byfor example if you order by group name this would becomeORDER BY agl.`name`'); public function getAttributesGroups($id_lang) { return 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.`id_image`, 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).' ORDER BY pa.`id_product_attribute`'); } The other more complex method would be to add a sequence column to the DBthis would require some modification to the adminhope that helps ;-) Link to comment Share on other sites More sharing options...
retrospecter Posted July 17, 2008 Author Share Posted July 17, 2008 Dear Awmdesing, Thanks a lot for your great help. Everything is easy in prestashop... Link to comment Share on other sites More sharing options...
trusktr Posted July 8, 2009 Share Posted July 8, 2009 There should be a feature added to prestashop that allows you to specify the order in the drop down list. (kinda like modules positions) Link to comment Share on other sites More sharing options...
Recommended Posts