Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Jan 2008
    Posts
    12
    Plugin Contributions
    0

    Default 1000 is more than 200

    Can someone please teach my Zencart list of products that a series product with 200 in the name should come before a product with 1000 in it's name? This is real annoying. I don't want to and shouldn't have to go back through and set sort orders to make this happen. As soon as Zencart sees a 1, it puts it before anything else.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: 1000 is more than 200

    To a human brain, it seems stupidly simple... but there are many ways that numbers could appear in product names, and parsing the name to single out embedded undefined multi-digit numbers, remember them and sort them in relation to other similar names would exponentially increase the processing time for the sort.
    You can add zeros to fill out the maximum number of digits, and it might work to add spaces, non-breaking spaces, or some other character similarly. There is a PHP "natural sort" function that sorts numbers in string format as humans would see them, but I don't know if it would still work on mixed alphameric content.

  3. #3
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1000 is more than 200

    Product names are alphanumeric strings and when sorted alphabetically 1 comes before 2, irrespective of the number of zeros that follow.

    However, Zen Cart does have a product sort order field for each product that is used in some places to allow site owners to override the normal ordering.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #4
    Join Date
    Apr 2012
    Posts
    9
    Plugin Contributions
    0

    Default Re: 1000 is more than 200

    This s a big problem for me as well. I know this thread is a year old but it seemed a good place to add this question:

    Is it possible to manually sort only a group of products?

    In my case I sell comics which, of course, have issue numbers. But not all of my products need sorting (where issue numbers don't go past #9, for example).

    I'm guessing the answer is 'no' as I couldn't find any good solution in the forums. But I had to ask. It just seems so silly that default ordering ends up looking like this:

    Super Fun Comics #1
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #2
    Super Fun Comics #23
    Super Fun Comics #3
    Super Fun Comics #36

    Thanks in advance!

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: 1000 is more than 200

    As kuroi has pointed out, when digits are listed in an alpha-numeric string, they are regarded as TEXT, not numerical values.

    This is true in ANY computer program - not just zencart.

    The only way to force a desired sort order is to use the sort ordering system in zencart.

    We had a project a couple of years ago where over 10,000 products, in over 400 categories/sub-categories needed specialist sorting.

    It took a while, but we used Easy Populate to help us, where we brought the EP file into MS Excel, and using MS Excel formulae and data sort features, we were able to insert the desired ZC sort order values in a few hours - rather than the weeks it would have taken to do it product-by-product in ZC.
    19 years a Zencart User

  6. #6
    Join Date
    Apr 2012
    Posts
    9
    Plugin Contributions
    0

    Default Re: 1000 is more than 200

    Quote Originally Posted by schoolboy View Post
    As kuroi has pointed out, when digits are listed in an alpha-numeric string, they are regarded as TEXT, not numerical values.

    This is true in ANY computer program - not just zencart.
    Well, I can grasp the concept, I just have trouble accepting it! When I access my files in Windows they're ordered as I'd expect. Super Fun Comics #2 comes before Super Fun Comics #10, for example.

    I don't doubt what you're saying and I'm not trying to put down Zen Cart (which I like a lot), just saying the default sorting isn't what I'd expect.

    Anyhow, as I mentioned, I was hoping there might be a way to manually sort a small group (a particular comic series, for example). A workaround, a mod, a secret trick!

    Thanks for the suggestion, I appreciate it. I was really hoping for something a bit simpler...
    Last edited by rickobee; 15 Apr 2012 at 11:48 PM. Reason: Shameful incorrect OpenOffice example...

  7. #7
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 1000 is more than 200

    Quote Originally Posted by rickobee View Post
    Anyhow, as I mentioned, I was hoping there might be a way to manually sort a small group (a particular comic series, for example). A workaround, a mod, a secret trick!

    Thanks for the suggestion, I appreciate it. I was really hoping for something a bit simpler...
    There IS a 'simple trick' that you can use:

    Instead of using descriptions like:

    Super Fun Comics #1
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #2
    Super Fun Comics #23
    Super Fun Comics #3
    Super Fun Comics #36

    You'll need to 'pad' the 'numeric' strings out with zeros, like:

    Super Fun Comics #01
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #02
    Super Fun Comics #23
    Super Fun Comics #03
    Super Fun Comics #36

    This will then cause the sorted display to show as:
    Super Fun Comics #01
    Super Fun Comics #02
    Super Fun Comics #03
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #23
    Super Fun Comics #36

    Needless to say, if there are more than 99 Comics you'll need to use three digit numbers, such as:

    Super Fun Comics #001
    Super Fun Comics #002
    Super Fun Comics #003
    Super Fun Comics #010
    Super Fun Comics #017
    Super Fun Comics #023
    Super Fun Comics #036
    Super Fun Comics #150
    Super Fun Comics #300
    etc, etc.

    As mentioned, this isn't a zencart issue, and in spite of your statement that "When I access my files in Windows they're ordered as I'd expect" it is a universal issue that is not limited to any given operating system. It is an issue that goes back the the very core of computing because numbers are always lower in the ASCII tables than strings, so 1000 represented as a string "1000" is always going to appear before the number 200 represented as a string value of "200".

    If a system does ever display a sorted set of strings such as
    Super Fun Comics #1
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #2
    Super Fun Comics #23
    Super Fun Comics #3
    Super Fun Comics #36

    in the 'correct' order of:
    Super Fun Comics #1
    Super Fun Comics #2
    Super Fun Comics #3
    Super Fun Comics #10
    Super Fun Comics #17
    Super Fun Comics #23
    Super Fun Comics #36

    It is actually done splitting the strings into their different 'elements' and performing a sort on each element. IOW, it'll first sort all of the "Super", then all the 'Fun", following by the "Comics", and finally by the *numeric equivalent* of the number strings. All things considered, this adds up to a lot of CPU power for such a simple requirement. Most coders would never go to this extent with a sort routine unless there is a real proven need for it. It'd be easier to separate the string component and the numeric components in the first place.

    Important thing to note is that the TEXT STRING "1" is *NOT* the same as the NUMBER "1", and to take this one step further, you could also have a graphic picture that shows a "1", and needless to say, even though this "1" will *look* the same as the text and numeric '1's this won't work correctly in a sort function either.

    Hopefully this explanation goes a little way to helping you accept the situation, as well as grasp it. :)

    Cheers
    Rod

  8. #8
    Join Date
    Apr 2012
    Posts
    9
    Plugin Contributions
    0

    Default Re: 1000 is more than 200

    Haha, well, I suppose I have no choice but to accept it! Thanks for your informative explanation, Rod.

    It is actually done splitting the strings into their different 'elements' and performing a sort on each element. IOW, it'll first sort all of the "Super", then all the 'Fun", following by the "Comics", and finally by the *numeric equivalent* of the number strings.
    Now that's what I'm talking about! At least I know it can be done, eh?

    I wonder if an add-on could be built (or a core improvement) that could simply add an extra field to the title for numbers? If the field was populated it'd be added to the end of the title (and would be the secondary sorting criteria). Of course, I have no idea how to construct such a thing but one can dream.

    In the meantime I suppose I'll have to break down and add the extra zeroes to the issue numbers. Thanks again!

  9. #9
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: 1000 is more than 200

    Maybe I missed something, but why don't you just ad a value to the sort order field?

  10. #10
    Join Date
    Apr 2012
    Posts
    9
    Plugin Contributions
    0

    Default Re: 1000 is more than 200

    Well, because I've already got 2000+ products added (I'd assumed the sorting thing would be an easy fix) and don't really want to edit them one by one. And that feature just seems more trouble than it'd be worth since I've got a constantly rotating stock...

    I don't think that option had actually come up in this thread though so thanks for mentioning it!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 No USPS shipping options or estimates if order total greater than $1000
    By spyderrobotics in forum Addon Shipping Modules
    Replies: 14
    Last Post: 5 Oct 2014, 03:42 PM
  2. Send discounts only to customers who oredered more than $1000. How to set?
    By ilmarchez in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 3 Dec 2010, 04:51 PM
  3. <strong>Looking Deeper Than The Top 1000</strong>
    By bumba000 in forum General Questions
    Replies: 5
    Last Post: 9 Apr 2007, 01:22 AM
  4. Module Shipping. Free shipping for order more than 200€.
    By maci in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 3 Aug 2006, 09:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR