Forums / Basic Configuration / Product Listing Default Sort Order

Product Listing Default Sort Order

Locked

Started by mordechai on 10 Jul 2007, 3:17 PM · Views: 62,700

Results 81 to 86 of 86
This thread is locked. New replies are disabled.
12 Oct 2014, 5:14 AM
#81
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Product Listing Default Sort Order

FYI...all of the db changes made in zen_configuration have been applied to each of the listings (new, featured, and all).

12 Oct 2014, 2:25 PM
#82
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Listing Default Sort Order

I have not tried this, but I believe you will want to change listing_display_order.php

<option value="9" <?php echo ($disp_order == '9' ?  'selected="selected"' : ''); ?>><?php echo  TEXT_INFO_SORT_BY_PRODUCTS_WEIGHT; ?></option>

from 9 to 8 ...

Then, look at the file:
/includes/modules/listing_display_order.php

and add the case for 8:

  case ($_GET['disp_order'] == 8):
  $order_by = " order by p.products_weight, pd.products_name";
  break;

NOTE: I added the products_name in there so there was some order when sorted by weight and there are a dozen products with weight of 1 and something to sort all of those to a logical order ...

The reason to use 8 vs 9 is that the default on the case was intended to work on the sort_order which was what to do when there was no match ... and while the admin settings show 1-8 you will see there is no 8 in the case statements in the original code ...

On your changes for the database settings, change those so that they display with 8 for the weight rather than 9 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Oct 2014, 6:26 PM
#83
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: Product Listing Default Sort Order

That did the trick! I left everything labeled as 9 (since the admin area has an 8 for product sort order for new, featured, and all products...).

Thanks for your help.

19 Dec 2014, 2:40 AM
#84
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Product Listing Default Sort Order

Is it possible to list products in admin by manufacturer name as search result, sort order or manufacturer page?

24 Jan 2016, 3:49 PM
#85
acmaurer avatar

acmaurer

New Zenner

Join Date:
Jan 2012
Posts:
27
Plugin Contributions:
0

Re: Product Listing Default Sort Order

Ajeh:

When the Product Listing is displayed, click on the titles ... you will see a sort=#x in the URL ... that is the sort order setting for that display ...

Get the display in the order that you want for the default to be ... then using that sort=#x enter that as the Sort Order on the Product Listing ...

The perfect answer! But I had exactly the same question as morechai 11 years later and the instructions are exactly the same--just as opaque--as they were then. In most of the other configuration boxes the options are described. In the Zen Wiki, this particular setting isn't even addressed--it's link redirects to configuring Gift Certificates!

I searched for this answer for an hour. Thanks again for providing it!

13 Aug 2020, 10:32 AM
#86
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,879
Plugin Contributions:
7

Re: Product Listing Default Sort Order

This thread still pops up first for sort order queries.

In this mod
https://www.zen-cart.com/showthread.php?205606-Product-Listing-Sorter-Drop-Down
there is a detailed description of how the sorting works.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...