-1

I want to show products with $0 price on last. I am trying to make changes in file app/design/frontend/default/YOUR_TEMPLATE/template/catalog/product/view.phtml

if($_product->price==0):

but can't do it and don't know how to do it. Please anyone tell me how can i do it.

  • Elaborate your question. What you want to do? Show $0 on last? What last? – Ali Zaki Jan 7 '17 at 11:06
  • @ali zaki thanks to give ma a chance to improve my question. i have products that price is $0. but i don't want to show on first priority. i want to display $0 products of the last priority – Grace Jan 7 '17 at 11:13
  • i want to display $0 price product at the End of all products – Grace Jan 7 '17 at 11:25
  • You can set position to that product for particular category from admin. – prathmeshb1 Jan 7 '17 at 11:27
  • thanks @ prathmeshb but i want to do it dynamically with programming – Grace Jan 7 '17 at 12:03
0

Go to Catalog->Manage Categories select a category then go to Category Products Tab and set position of product i.e. 1, 2 3 4 etc as you like, on frontend product will display according to your position set i.e 1 will display first and so on.

| improve this answer | |
  • you can Accept my answer if your problem is solved. – Ali Zaki Jan 7 '17 at 11:37
  • i would like to do it with programming i haven't need to go again and again in admin panel – Grace Jan 7 '17 at 12:08
0
  1. You need do 2 change one is go to admin -> system -> Configuration -> Catalog there in tab Front end you find 'Product Listing Sort by' select price and save config.
  2. Copy

    app\code\core\Mage\Catalog\Block\Product\List

and copy file Toolbar.php and put

app\code\local\Mage\Catalog\Block\Product\List

then change one line

protected $_direction           = 'asc'; to protected $_direction = 'desc';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.