Page 1 of 1

Save default order criteria

Posted: Thu Oct 04, 2012 12:45 pm
by amedeo
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

Re: Save default order criteria

Posted: Sun Oct 07, 2012 5:34 am
by Brent
You want the product to be listed in the catalog sorted buy price?

Re: Save default order criteria

Posted: Sun Oct 07, 2012 7:32 am
by amedeo
Yes, I want the default order criteria descending by price

Re: Save default order criteria

Posted: Mon Oct 08, 2012 7:33 am
by Brent
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.