Zen Cart Logo
Forums / General Questions / Option Names ... how do I sort by sort number?

Option Names ... how do I sort by sort number?

Views: 1,593

Results 1 to 16 of 16
16 Jan 2016, 6:55 PM
#1
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Option Names ... how do I sort by sort number?

In v 1.3.9 I had 20 color variations with a sort number of 100
5 size variations with a sort number of 200
several numerical options with a sort order of 300

The result was items are groups and always displayed alphabetically, even after adding new options.

v1.5.4 only offers sort by Option ID and ID Name.

How can I get v1.5.4 to sort by sort#?

TIA

17 Jan 2016, 12:50 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Option Names ... how do I sort by sort number?

had 20 color variations with a sort number of 100
These should not all have the same sort order number
Use something like
100
110
120
130
etc

17 Jan 2016, 4:53 AM
#3
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

kobra:

These should not all have the same sort order number
Use something like
100
110
120
130
etc

Why? Even if I did, the display does not sort by sort number, and that's what I want. 1.5.4 offers only two options, ID# and Name.

17 Jan 2016, 5:36 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Option Names ... how do I sort by sort number?

You can set order in the attributes controller

17 Jan 2016, 5:45 AM
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

Not that I can help....
I think the OP might be talking about
Admin
Catalog
Option Name Manager

17 Jan 2016, 8:00 AM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

When I go to product info on zc 1.5.4, there is the following option: Products Info - Products Option Name Sort Order
Please make any necessary changes

Products Info - Products Option Name Sort Order
Sort order of Option Names for Products Info
0= Sort Order, Option Name
1= Option Name

0
1

This allows sorting at least the option names by sort order, and if two or more option names have the same sort order then it is supposed to sort by name... As for the values, there is a sort order there as well...

If they are not sorting by these values, there is always the store manager under the tools menu, which has a reset option for option names and values... That may restore the sorting that you seem to want for your product.

17 Jan 2016, 5:12 PM
#7
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

mc12345678:

When I go to product info on zc 1.5.4, there is the following option: Products Info - Products Option Name Sort Order
Please make any necessary changes

Products Info - Products Option Name Sort Order
Sort order of Option Names for Products Info
0= Sort Order, Option Name
1= Option Name

0
1

This allows sorting at least the option names by sort order, and if two or more option names have the same sort order then it is supposed to sort by name... As for the values, there is a sort order there as well...

If they are not sorting by these values, there is always the store manager under the tools menu, which has a reset option for option names and values... That may restore the sorting that you seem to want for your product.

I tried that. Products info is set @ 0
Went to tools/store manager, that did no good either.
Went to catalog/name sorter ... even changed sort#s. That screen sorted by sort number, but in
/[admin]/options_name_manager.php, it will still not sort by sort#

17 Jan 2016, 6:57 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

xcergy:

I tried that. Products info is set @ 0
Went to tools/store manager, that did no good either.
Went to catalog/name sorter ... even changed sort#s. That screen sorted by sort number, but in
/[admin]/options_name_manager.php, it will still not sort by sort#

Ohhhh.. So the goal has been to display option names in sort order on the option_names_manager this entire time??? Ohh... Well, that can be done with:

First add the language define file for the following addition:

in admin/includes/languages/YOUR_LANGUAGE/options_name_manager.php
add a define for sort order like this:

define('TEXT_OPTION_SORT_ORDER', 'Option Sort Order');

find, this was around line 562 of admin/options_name_manager.php (line number was referenced from a file that has already been modified to support Stock-By-Attributes and therefore line number is likely off by a bit):

                <td valign="top" align="left"><form name="option_order_by" action="<?php echo zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'option_order_by=' . $option_order_by, 'NONSSL'); ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option></select></form></td>

And "add"/replace with:

                <td valign="top" align="left"><form name="option_order_by" action="<?php echo zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'option_order_by=' . $option_order_by, 'NONSSL'); ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option><option value="products_options_sort_order"<?php if ($option_order_by == 'products_options_sort_order') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_SORT_ORDER; ?></option></select></form></td>
17 Jan 2016, 7:05 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

mc12345678:

Ohhhh.. So the goal has been to display option names in sort order on the option_names_manager this entire time??? Ohh... Well, that can be done with:

First add the language define file for the following addition:

in admin/includes/languages/YOUR_LANGUAGE/options_name_manager.php
add a define for sort order like this:

define('TEXT_OPTION_SORT_ORDER', 'Option Sort Order');

> 
> find, this was around line 562 of admin/options_name_manager.php (line number was referenced from a file that has already been modified to support Stock-By-Attributes and therefore line number is likely off by a bit):
> ```
                <td valign="top" align="left"><form name="option_order_by" action="<?php echo zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'option_order_by=' . $option_order_by, 'NONSSL'); ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option></select></form></td>

And "add"/replace with:

            <td valign="top" align="left"><form name="option_order_by" action="<?php echo zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'option_order_by=' . $option_order_by, 'NONSSL'); ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option><option value="products_options_sort_order"<?php if ($option_order_by == 'products_options_sort_order') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_SORT_ORDER; ?></option></select></form></td>

If want an Ascending/Descending option, then:
            <td valign="top" align="left"><form  name="option_order_by" action="<?php echo  zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'option_order_by=' .  $option_order_by, 'NONSSL'); ?>"><select name="selected"  onChange="go_option()"><option value="products_options_id"<?php  if ($option_order_by == 'products_options_id') { echo ' SELECTED'; }  ?>><?php echo TEXT_OPTION_ID; ?></option><option  value="products_options_name"<?php if ($option_order_by ==  'products_options_name') { echo ' SELECTED'; } ?>><?php echo  TEXT_OPTION_NAME; ?></option><option  value="products_options_sort_order ASC"<?php if ($option_order_by ==  'products_options_sort_order ASC') { echo ' SELECTED'; } ?>><?php  echo TEXT_OPTION_SORT_ORDER_ASC; ?></option><option  value="products_options_sort_order DESC"<?php if ($option_order_by ==  'products_options_sort_order DESC') { echo ' SELECTED'; } ?>><?php  echo TEXT_OPTION_SORT_ORDER_DESC; ?></option></select></form></td>

in admin/includes/languages/YOUR_LANGUAGE/options_name_manager.php
add a define for sort order like this:

define('TEXT_OPTION_SORT_ORDER_ASC', 'Option Sort Order ASC');


define('TEXT_OPTION_SORT_ORDER_DESC', 'Option Sort Order DESC');

17 Jan 2016, 7:20 PM
#10
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

@xcergy,

Please in the future be more specific about the problem. Doesn't require a lot of words, or complete sentences, but if had known that the issue was at admin/options_name_manager.php then a solution could have been provided a lot sooner... Yes, my "last" post was a few hours after RixStix had offered a potential location to "fix" which was confirmed hours after that post, but I had begun my post many hours before that and had wanted to wait to respond until I had at least reviewed my post. Finally reviewed and considered acceptable for posting (though didn't confirm what had already been added to the thread).

Anyways, my previous postings were with concern more about the store front part of operation. Yes I could have asked about where the issue was instead of offering "blind" advice... Please though, help everyone to be able to help you, give enought detail to reproduce the issue or to see where it is an issue (No, no one expects you to post your admin credentials).

Hope that helped. BTW, for anyone else that stumbles upon this looking for the same type thing, the value that is in the option value="" part is used as the mysql sort order criteria...

So if want to sort by other criteria or combinations of criteria, then can replace the pair of data with that new criteria and provide whatever "human readable" text represents that sort order in the language define...

17 Jan 2016, 8:22 PM
#11
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

Thanks. I'll work on that later, as well as my definition/problem skills.

This is a new site from scratch (my host killed my 1.3.9 site w a PHP version upgrade), and I am having template issues. I need to get those solved, get the site LIVE before I move on to other things & additional add-ons.

Keith

17 Jan 2016, 9:12 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

xcergy:

Thanks. I'll work on that later, as well as my definition/problem skills.

This is a new site from scratch (my host killed my 1.3.9 site w a PHP version upgrade), and I am having template issues. I need to get those solved, get the site LIVE before I move on to other things & additional add-ons.

Keith

It only helps you in the long run...

Hate to say it, but as far as "forcing" to the upgraded version, I guess it's a matter of perspective... Version of ZC last installed is over 5 years old. The ZC 1.5.x series was issued within that 5 years and has undergone 5 issued revisions (though one was more for developers than for usage as an active store). The developers have been warning about the need to upgrade (or make significant modifications) for a few years... The host on which the old store was hosted actually held out longer than many others have as PHP 5.2.x has been dropped from support for almost a year now... So, being forced to upgrade, well... Being forced to use more secure, up-to-date software, sure problematic etc...

None of that though really helps get through the troubles of changes... I can't recall if the removal of sorting by sort order was intentional or if it is something that is just different between a modified store and a default store, but to find modifications made to your original store (if didn't know), compare the files of that store against those of a default store (download available from the main page of this website).

The template files will need a similar comparison against the template_default equivalent (non-overridden version)

18 Jan 2016, 7:12 AM
#13
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

Oh, I get security needs changes, and is a pita for one that learns how to setup something, get's it going, and forgets the rules there after.

Do I really need to retain the knowledge how to setup a wireless router when it has been working fine for the average lifespan of the average dog? No, but I do remember the link how to get there ...
http://www.practicallynetworked.com/

The important thing about schooling is remembering links/.coms or other history to re-read.

Hey!!!! I'm still using MS Works v 4.5 (WIN 95 app) Thank goodness WIN7 still works w this program.

Now I see Zen 1.5.5. Do I need to upgrade? Do I need to uninstall the mods in the DB to revise to the new version that is yet to be LIVE online?

I still can't figure out how to read data from an SQL database .dmp file to backup/read to my Windows local machine that I have had no need to access for the last 6 years. ( another re-learn how to to get it up and running).

Sorry to rant, but I'm a one horse show, and have no $$ to buy a programmer, it's why I visit this forum. Paying forward is what e-commerce is all about. And a big TY for those that have replied in this thread!!!

Keith

18 Jan 2016, 9:11 AM
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

F you've got a. Local phpmyadmin or other sql like database, should be able to create an export file that is a .sql file that includes things like drop tables if exists, the data strructure as well as the data, etc.. There's a FAQ or two that has recently been posted about regarding import/export optiions. Dunno about a .dmp file... Not sure if it contains the generic instruction needed to be processed by a sql server...

While relatively close for distribution, I didn't think 1.5.5 was quite ready and that 1.5.4 was the most recent still at the moment... I would suggest going to 1.5.4 just because in the next couple of days there could be an update to the beta 1.5.5 that could undo a lot of work...

Have a couple of options regarding uninstall/etc.. If going to maximize the possibility of multiple combinations:
Put store in maintenance mode, backup current database.
Remove extra plugins, backup database.
Restore orginal database before removals.
Place store back in operation.

Build "temporary" store per: http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading
Get it all figured out about what needs to be removed/added in what sequence.. Be prepared to do the upgrade (of the database) one last time.. Contnue to follow above instruction to complete the store/database upgrade... Do more... :)

Roger the one horse wonder...

18 Jan 2016, 6:17 PM
#15
xcergy avatar

xcergy

Zen Follower

Join Date:
Feb 2009
Location:
Landrum SC
Posts:
141
Plugin Contributions:
0

Re: Option Names ... how do I sort by sort number?

mc12345678:

F you've got a. Local phpmyadmin or other sql like database, should be able to create an export file that is a .sql file that includes things like drop tables if exists, the data strructure as well as the data, etc.. There's a FAQ or two that has recently been posted about regarding import/export optiions. Dunno about a .dmp file... Not sure if it contains the generic instruction needed to be processed by a sql server...

While relatively close for distribution, I didn't think 1.5.5 was quite ready and that 1.5.4 was the most recent still at the moment... I would suggest going to 1.5.4 just because in the next couple of days there could be an update to the beta 1.5.5 that could undo a lot of work...

Have a couple of options regarding uninstall/etc.. If going to maximize the possibility of multiple combinations:
Put store in maintenance mode, backup current database.
Remove extra plugins, backup database.
Restore orginal database before removals.
Place store back in operation.

Build "temporary" store per: http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading
Get it all figured out about what needs to be removed/added in what sequence.. Be prepared to do the upgrade (of the database) one last time.. Contnue to follow above instruction to complete the store/database upgrade... Do more... :)

Roger the one horse wonder...

I'm keeping notes. One of my woes w 1.3.9 was lack of 'proper' documentation w add-ons. lesson learned.
Yes, I plan on exporting data from the SQL DB and see how that works. I have two websites, and once I get
http://www.thedumbdog.com/cat-1-5-4/ up and running [it looks horrible on my SmartPhone] then I will work on getting the other site revised, up and running. The downside (waiting to upgrade) is that site#2 [el-cheapo me] only allows one and only one SQL DB.

Keith

19 Jan 2016, 12:13 AM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Option Names ... how do I sort by sort number?

xcergy:

I'm keeping notes. One of my woes w 1.3.9 was lack of 'proper' documentation w add-ons. lesson learned.
Yes, I plan on exporting data from the SQL DB and see how that works. I have two websites, and once I get
http://www.thedumbdog.com/cat-1-5-4/ up and running [it looks horrible on my SmartPhone] then I will work on getting the other site revised, up and running. The downside (waiting to upgrade) is that site#2 [el-cheapo me] only allows one and only one SQL DB.

Keith

Well, somewhat tucked away in the instructions of above is how to figure out what was different about the site as compared to a base install.. Original files can be found from links on the main page of this website. Using comparison software you can determine what has been modified, and often can determine why it was modified (usually once seeing a lot of the changes, it is pretty obvious about why it is different, what needed the change, etc...)