Jump to content

Problem with Price Cart Rules sort order


Recommended Posts

There is a troublesome problem, the Rules Catalog Prices are displayed in reverse order from the last to the first, even when changing parameters in the DB: 

 

example: 

 

If prices have created these rules: 

 

Qty Price 

from 1 to 50 pieces - € 5.00 

from 51 to 100 pieces - € 10.00 

from 101 to 1000 pieces - €. 20.00 

 

in view in the template I find myself always as ordered: 

 

from 101 to 1000 pieces - €. 20.00 

from 51 to 100 pieces - € 10.00 

from 1 to 50 pieces - € 5.00 

 

nothing major and does not affect the operation of the rules, but for accuracy I'd like to see you order the right way and also to give the right message to the customer. 

post-818822-0-30438800-1407581458_thumb.jpg

Link to comment
Share on other sites

I found a simple solution on the web: 

 

http://stackoverflow.com/questions/13336153/smarty-foreach-array-sort-order

 

Practically it comes to replacing a line or a better option of the SQL statement that you find in the file: 
 
Classes / specificprice.php more or less from the line # 293 (but I found it to # 599) 
 
in this way: 
 
change 
ORDER BY `DESC id_product_attribute`, from_quantity`` DESC, `id_specific_price_rule` ASC, DESC` score` 

with

ORDER BY `id_product_attribute` DESC, `from_quantity` ASC, `id_specific_price_rule` ASC, `score` DESC
there is not even need to replace the whole line just change 'from quantity' DESC, in 'quantity from' ASC, 
but we must be careful not to add any other line, neither comment, nor white, otherwise it can not work, and return the white screen. 
 
For me it worked PS 1.6.0.8 and custom template. 
 
Bye!

 

Link to comment
Share on other sites

×
×
  • Create New...