Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Jul 2011
    Posts
    8
    Plugin Contributions
    0

    Default Packing Slip attributes sorting randomly

    On my packing slip (and admin invoice), the attributes are sorting in random order.... only 'sometimes'. (Works great on product pages, just odd at times on packing slip)

    i.e. (Product name and value sort orders set)
    Product Caramel Cheesecake
    Attribute 1: Bottle Size 5ml
    Attribute 2: Cool Hit
    Attribute 3: Base Mix 50/50
    Attribute 4: First Flavor Choice
    Attribute 5: First Flavor Percent
    Attribute 6: Second Flavor Choice
    Attribute 7: Second Flavor Choice

    Will RANDOMLY appear as (example, other random sorts happen as well):
    Attribute 5: First Flavor Percent
    1 Product Caramel Cheesecake
    Attribute 2: Cool Hit
    Attribute 7: Second Flavor Choice
    Attribute 3: Base Mix 50/50
    Attribute 4: First Flavor Choice
    Attribute 1: Bottle Size 5ml
    Attribute 6: Second Flavor Choice

    I would guess about 80% of the time it sorts correctly, and 20% randomly in any order. I've even had the qty/product line show up in between the products.

    I found an old thread about this from 2006 that has been closed, but had no answer.

    Any ideas on how to fix this?

    Thx

  2. #2
    Join Date
    Feb 2013
    Posts
    20
    Plugin Contributions
    0

    Default Re: Packing Slip attributes sorting randomly

    I got exactly the same problem. It's 2013 now. Did you find the solution?

    Thanks in advance.

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

    Default Re: Packing Slip attributes sorting randomly

    since the OP has not been around since 2011, chances are he won't answer.

    Please start by providing us some more info, like ZC version an installed add ons. Otherwise we can only guess

  4. #4
    Join Date
    Feb 2013
    Posts
    20
    Plugin Contributions
    0

    Default Re: Packing Slip attributes sorting randomly

    Hello there. I really need help. My ZC version is 1.5.1. No big add ons to mention.

    I have created products with 7 attributes and products with 12 attributes.

    My problem is: when I place an order, the attributes appear totally in random order in the ORDERS page, ORDER, INVOICE and PACKING SLIP. This happens specially when the order includes several products ( 2 or more of 7 attributes) or when the order has at least one product of 12 attributes.

    The interesting thing about this, it's that the ORDER CONFIRMATION EMAIL displays the information in the correct sort order, in the same sort order it appears in the website.

    Here you can see the page with the product with 12 attributes:

    http://armytags.com/tienda/index.php...kndsirkgba6vq5

    The page with a product of only 7 attributes:

    http://armytags.com/tienda/index.php...=1&language=en

    I want the attributes appear in the ORDERS in the exact same order they appear in the product page.

    For your information I have already set the sort value of option names. The order is SILENCERS: 10, CHAINS: 20, LINE 1: 30, LINE 2: 40 and so on....

    The same goes for OPTION VALUES. I created a sort order for: SILENCERS OPTIONS: Black (0), Clear (1), Blue (2) and so on. CHAINS: 24" (14), 27" (15), 30" (16).

    The TEXT attributes has no options, however I have given a consecutive ORDER: LINE 1 (19), LINE 2 (20) and so on, just in case. I have even assigned order numbers of bigger value than the previous attributes: SILENCERS and CHAINS to make sure they will appear after the first two attributes.

    I have seen this topic has been a recurrent question along the years, but there is not a thread with the solution. I am afraid it has to be with the algorithm of the processing of the cart or the code in orders.php or order.php

    I have made several TEST orders and the only pattern I have noticed is when there are a lot of products with attributes involved, the system gets crazy and order the attributes in a random order. Something a noticed: when I order 3 products, the attributes of at least one product appears ok, but the ones of the others product display totally in a random order, with no pattern.

    In this thread ( http://www.zen-cart.com/showthread.p...e-packing-slip )

    this person mentions this piece of code:

    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
    for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
    echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
    echo '</i></small></nobr>';
    }
    }

    I don't know if it is related and the loop collapses when the number of attributes is over a certain number (attributes > 10). In my case this seems to happen. But I don't know how to interpretate the code, since I am not an expert in PHP.

    In my investigation I also found this ( http://coding.derkeiler.com/Archive/.../msg00094.html )

    The title is: " $j++ oddtities from PHP 4.4.8 to 5.2.0 "

    This guy says:

    "Hi,

    Migrating an application from PHP 4.4.8 to 5.2.0 hosted under debian, I'm encountering a weird thing that look like a bug, but I don't know from where the problem is comming: me, debian patch, or php himself.


    Try the following pretty stupid sample code below (command line oriented, replace \r\n by <br> to test it from a web server):

    <?php
    // PHP 4.4.8 give the following:
    // 0 - 0 - 0
    // 1 - 1 - 1
    // 2 - 2 - 2
    // ...and so on
    //
    // PHP 5.2.0 give the following:
    // 0 - 0 -
    // 1 - 1 - 0
    // 2 - 2 - 1
    // ...and so on
    .
    .
    . (continues)

    ¿Will that be related to my problem?

    I am not an expert in PHP programming, but I have the feeling that the problem is the algorithm or the PHP processing. Can anybody check that?

    Thanks in advance for your tips and suggestions.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Packing Slip attributes sorting randomly

    I did a test order on your site and everything I can see is in order ... did the order itself for #10332 come out in the right method?

    So far on my test site I cannot break the sort order of my attributes either ...
    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: v1.5.5]
    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!

  6. #6
    Join Date
    Feb 2013
    Posts
    20
    Plugin Contributions
    0

    Default Re: Packing Slip attributes sorting randomly

    Hi Linda. Thanks for you time.

    I received your order. It arrived ok.

    Products Ordered: 1
    1 x Order STEEL (2 equal dog tags)
    - Silencers Color: Blue
    - Chain Length: 27"
    - LINE 1: test 1
    - LINE 2: test 2
    - LINE 3: test 3
    - LINE 4: test 4
    - LINE 5: test 5

    In a perfect world, all of the products in the order should arrive in this order. The crazyness happens when there is more than one product ordered ( 2 or more ) or when you place an order with one product of more than 7 attributes ( two dog tags different = 12 attributes).

    I encourage you to test with more than one product or at least one product with two dog tags different.

    Sincerely:

    Alfonso

  7. #7
    Join Date
    Feb 2013
    Posts
    20
    Plugin Contributions
    0

    Default Re: Packing Slip attributes sorting randomly

    Here is an example of what I get:

    Products Ordered: 3
    1 x Order SHINY (2 equal dog tags)
    #### - Silencers Color: Red
    #### - Chain Length: 27 "
    #### - Line 1: 1
    #### - Line 2: 1
    #### - Line 3: 1
    #### - Line 4: 1
    #### - LINE 5: 1
    1 x Order STEEL (2 equal dog tags)
    #### - LINE 5: a
    #### - Line 4: a
    #### - Line 3: a
    #### - Line 2: a
    #### - Line 1: a
    #### - Chain Length: 27 "
    #### - Silencers Color: Black
    1 x Order WWII (2 equal dog tags)
    #### - Line 3: 1
    #### - Line 4: 1
    #### - LINE 5: 1
    #### - Line 2: 1
    #### - Line 1: 1
    #### - Chain Length: 27 "
    #### - Silencers Color: Green

    The first product: OK.
    The second one: INVERTED ORDER.
    The third one: totally random...

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Packing Slip attributes sorting randomly

    Weird ... I still cannot repeat this on my site ...

    Could you add the three Products to your customer basket then go to phpMyAdmin and browse the table customers_basket_attributes and look to see how those attributes are stored?

    Do they all have the field products_options_sort_order filled in?

    Are you able to do a screen shot of that?
    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: v1.5.5]
    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!

  9. #9
    Join Date
    Feb 2013
    Posts
    20
    Plugin Contributions
    0

    Default Re: Packing Slip attributes sorting randomly

    Hi Linda.

    This is what I get after I included 3 products with 26 attributes ( 2 of 7 and 1 of 12). I have never manipulated any value here. Are they ok? do you need another view?

    Thanks again for your time and concern.


    Click image for larger version. 

Name:	SCR1.jpg 
Views:	70 
Size:	64.9 KB 
ID:	12270Click image for larger version. 

Name:	SCR2.jpg 
Views:	54 
Size:	49.9 KB 
ID:	12271Click image for larger version. 

Name:	SCR3.jpg 
Views:	57 
Size:	54.3 KB 
ID:	12272

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Packing Slip attributes sorting randomly

    I was kind of hoping to see all the fields for your customers_id for all of the products/attributes added to the customers_basket_attributes to see what is being put in each of the fields ...
    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: v1.5.5]
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Packing Slip
    By coffee23 in forum Customization from the Admin
    Replies: 2
    Last Post: 13 May 2010, 09:33 PM
  2. packing slip
    By bean_2k1 in forum Managing Customers and Orders
    Replies: 5
    Last Post: 20 Mar 2008, 09:27 AM
  3. Packing Slip to Dropship Slip
    By PaintBall in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 28 Oct 2007, 12:10 AM
  4. Attributes sort order for invoice/packing slip
    By aeolidia in forum Managing Customers and Orders
    Replies: 6
    Last Post: 8 Nov 2006, 11:15 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