Save default order criteria

Support for Template related issues
Post Reply
amedeo
Posts: 10
Joined: Sun Mar 27, 2011 8:03 am

Save default order criteria

Post by amedeo » Thu Oct 04, 2012 12:45 pm

How to save the order of the products ascending by price, for example, as default for my store? To assign a order for each product in Admin-->catalog-->Products-->Sort by price-->Change every sort order is to hard.
Second way is using Catalog Search, but I want to customize this on price ascending. How can I do that?
Thank you,
Amedeo

User avatar
Brent
Site Admin
Posts: 4419
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Save default order criteria

Post by Brent » Sun Oct 07, 2012 5:34 am

You want the product to be listed in the catalog sorted buy price?

amedeo
Posts: 10
Joined: Sun Mar 27, 2011 8:03 am

Re: Save default order criteria

Post by amedeo » Sun Oct 07, 2012 7:32 am

Yes, I want the default order criteria descending by price

User avatar
Brent
Site Admin
Posts: 4419
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Save default order criteria

Post by Brent » Mon Oct 08, 2012 7:33 am

This is controller in the controllers.
For example in catalog/controller/category.php, at about line 151, you will see the following code.

Code: Select all

				if ($default_filter == $language->get('entry_number')){
					$search_filter = ' order by p.sort_order, pd.name ';
				} else {
					$search_filter = ' order by p.price ';
				}
				If ($default_order == $language->get('entry_ascending')){
					$search_order = ' asc ';
				} else {
					$search_order = ' desc ';
You can just change it to:

Code: Select all

				if ($default_filter == $language->get('entry_number')){
					$search_filter = ' order by p.price ';
				} else {
					$search_filter = ' order by p.price ';
				}
				If ($default_order == $language->get('entry_ascending')){
					$search_order = ' asc ';
				} else {
					$search_order = ' asc ';
This will disable the choices for now and always sort by price ASC.
This feature is in the side bar options that allow sort be price or by sort aorder ASC or DESC if you had that enabled.

Post Reply