Forums / Zen Cart Code Suggestions / admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

Views: 97

Results 1 to 5 of 5
21 Sep 2019, 9:59 PM
#1
torvista avatar

torvista

Totally Zenned

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

admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

This is used in a lot of admin pages for product selection, for example:
Attachment 18663

Out of the box this sorts by product name, which is useless for me so I have in the past changed the function order by to products_model.

While modifying a file that uses it, as above, I was thinking to add on-the-page options to change the sort order (using an additional parameter in the function), then thought that probably whatever anyone would want for one page, they would want the same for all, so maybe it would be better (and a lot easier) as an admin switch to control the function (for sorting by name/model/id or whatever else).

Opinions?
On the page selection or admin switch? Or the rest of the world is happy with sort by name?

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

23 Sep 2019, 10:06 AM
#2
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,018
Plugin Contributions:
2

Re: admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

I sought of did that several years ago (v154 2015) for several of the columns in the title bar for Manufacturers All About v1.1 admin page and then did similar to a few other admin pages (eg banner manager) since I found the code readily transportable to those other pages with just a few minor tweaks. However I have not tested this for later versions.

see post #9
https://www.zen-cart.com/showthread.php?216258-Manufacturers-All-About-Support

added facility to sort by ID, manufacturers_name, status and sort_order columns to admin manufacturers page

https://www.zen-cart.com/downloads.php?do=file&id=1966

hope this helps

24 Sep 2019, 5:31 PM
#3
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

Re: admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

Yes, this would be very useful. I encounter a similar drop down when using the edit orders module to add a product. Being able to change the sort order would be very helpful.

The ability to change the sort order right on the page makes it even better.

24 Sep 2019, 7:41 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

edadk:

Yes, this would be very useful. I encounter a similar drop down when using the edit orders module to add a product. Being able to change the sort order would be very helpful.

The ability to change the sort order right on the page makes it even better.
FWIW, I've opened an issue on Edit Orders GitHub repository to track this change request (https://github.com/lat9/edit_orders/issues/138).

26 Sep 2019, 11:59 AM
#5
torvista avatar

torvista

Totally Zenned

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

Re: admin function zen_draw_products_pull_down: order by, Admin switch or selectable?

I realised eventually that there is an Admin switch for the prev-cat-next navigation buttons (Admin-Configuration-Product Info-Previous Next Sort Order).
With minor modifications to function zen_draw_products_pull_down (and adding an extra parameter to the function call), the same sort order can also used for the product listing below it, so the navigation order and product select order are in sync.

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