kinkibcn Posted October 1, 2012 Share Posted October 1, 2012 Hello, I need help to sort articles by a new field that I have added to the table "product", called "charges" and is of type INT (10). The new field is crated and updated with some values. It is a field that will be directly updated on the MySQL table, so requires no maintenance from BO and needed only to sort the category product list. The aim is that in the drop down "Sort by:" can list the products ordered by the new field "charge" ascending / descending. To do this I modified my template file "product-sort.tpl" adding these two lines: <option value="{$link-> addSortDetails ($ request, 'charges',' asc ') | escape:' htmlall ':' UTF-8 '} "{if $ orderby eq' loads' AND $ orderway eq 'asc '} selected = "selected" {/ if}> {ls =' Uploads: ascending '} </ option> <option value="{$link-> addSortDetails ($ request, 'charges',' desc ') | escape:' htmlall ':' UTF-8 '} "{if $ orderby eq' loads' AND $ orderway eq 'desc '} selected = "selected" {/ if}> {ls =' Uploads: descending '} </ option> The problem is that it does not work, and I think it is because I have not defined this new field "charges" in Prestashop and PS does not recognize it. Can anyone help me about how to properly define this new field ?. Thanks for your help. Toni Link to comment Share on other sites More sharing options...
Recommended Posts