PDA

View Full Version : change default product sort order



DanDan
06-08-2012, 07:42 PM
I would like the product default sort order to be Price (low to high) on the product listing page. I am using the grid product display. I have looked at product_listing_col.php and see the options but cannot figure out how to change the default selection. How can I do this?

thanks,

Dan

pgmarshall
06-09-2012, 08:34 AM
Try changing in product_listing_cols and product_listing:

tep_draw_pull_down_menu('sort', $sort_array, $_GET['sort'], 'onChange="this.form.submit();"')

to

tep_draw_pull_down_menu('sort', $sort_array, (isset($_GET['sort']) ? $_GET['sort'] : '4a'), 'onChange="this.form.submit();"')

Not tested or tried but should work!

Regards.

DanDan
06-09-2012, 11:36 AM
thanks for your response. I tried it on both product_listing_cols and product_listing but it did not work on either one. It still is sorting by Product Name (a-z) as the selected sort. I also tried it with Display Best Sellers sort turned on and off in admin/product listing and that made no difference.

DanDan
06-14-2012, 12:21 PM
I deleted all but the options for sorting by price in the sort box in product_listing_cols but it still defaults to sorting by Product Name (A - Z) even though they are no longer options. I viewed source and it showed:

<select name="sort" onChange="this.form.submit();">
<option value="4a">Price (Low - High)</option>
<option value="4d">Price (High - Low)</option>
</select></form>

I then switched to the list format where I did not remove the options and viewing source showed:

<select name="sort" onChange="this.form.submit();">
<option value="0d">Bestsellers</option>
<option value="3a" SELECTED>Product Name (A-Z)</option>
<option value="3d">Product Name (Z-A)</option>
<option value="4a">Price (Low - High)</option>
<option value="4d">Price (High - Low)</option>
</select></form>


There must be another area where this option is selected. Does anyone have any ideas?

Dan