osCmax v2.5 User Manual
Results 1 to 9 of 9

Sort order & Packing list by item number

This is a discussion on Sort order & Packing list by item number within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; This is driving me nuts.. I have searched here and at oscommerce.com and every fix I found returned an error. ...

      
  1. #1
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Sort order & Packing list by item number

    This is driving me nuts.. I have searched here and at oscommerce.com and every fix I found returned an error.

    I would like the Packing Slip at least or that and the Invoice to sort the products by product ID.. It would just make my life so much easier to pack the orders...

    thanks

    Debbie D
    NY & VA

  2. #2
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Default Re: Sort order & Packing list by item number

    I may be wrong but its worth a shot! Look around line 83 in your classes/order.php file and see if it makes a difference to add

    Code:
    order by op.orders_products_id DESC
    at the end of the sql query.

    bh

  3. #3
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Sort order & Packing list by item number

    Well I never thought to look there and I forgot to mention I am working with oscMax so my line numbers will be far different than the standard osc files.

    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
    $this->products[$index] = array('qty' => $products[$i]['quantity'],
    'name' => $products[$i]['name'],
    'model' => $products[$i]['model'],
    'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
    'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
    'price' => $products[$i]['price'],
    'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
    'weight' => $products[$i]['weight'],
    'id' => $products[$i]['id']);
    there is no sort set on that section

    this query further up does have a sort, but it is for the totals.
    $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
    So if it needs to get added to the 1st block of code I showed, where??? and how??

    thanks
    Debbie D
    NY & VA

  4. #4
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Default Re: Sort order & Packing list by item number

    hmm... you should see a line in the file that says something like...
    Code:
     $orders_products_query = tep_db_query("select op.orders_products_id, op.products_id, op.products_name....
    Thats the line i was talking about.

  5. #5
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Sort order & Packing list by item number

    OK got it.. admin/classes/order.php

    $index = 0;
    $orders_products_query = tep_db_query("
    SELECT
    op.orders_products_id,
    op.products_name,
    op.products_model,
    op.products_price,
    op.products_tax,
    op.products_quantity,
    op.final_price,
    p.products_tax_class_id,
    p.products_weight
    FROM " . TABLE_ORDERS_PRODUCTS . " op
    LEFT JOIN " . TABLE_PRODUCTS . " p
    ON op.products_id = p.products_id
    WHERE orders_id = '" . (int)$order_id . "'");
    So before I mung it all up and shut my shop down .. I should change this to look like:

    $index = 0;
    $orders_products_query = tep_db_query("
    SELECT
    op.orders_products_id,
    op.products_name,
    op.products_model,
    op.products_price,
    op.products_tax,
    op.products_quantity,
    op.final_price,
    p.products_tax_class_id,
    p.products_weight
    FROM " . TABLE_ORDERS_PRODUCTS . " op
    LEFT JOIN " . TABLE_PRODUCTS . " p
    ON op.products_id = p.products_id
    WHERE orders_id = '" . (int)$order_id . "' .
    order by op.orders_products_id DESC");
    would that be correct?
    Debbie D
    NY & VA

  6. #6
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Default Re: Sort order & Packing list by item number

    that's exactly what i was talking about. see if it works for you.

  7. #7
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: Sort order & Packing list by item number

    Thanks for the help .

    FROM " . TABLE_ORDERS_PRODUCTS . " op
    LEFT JOIN " . TABLE_PRODUCTS . " p
    ON op.products_id = p.products_id
    WHERE orders_id = '" . (int)$order_id . "'
    order by op.orders_products_id DESC");
    had to adjust what I had above to this to not get anyy errors.. but no sorting is being done.. hahah wait it ordered it by the product ID not the item model.. so a little more playing around:

    LEFT JOIN " . TABLE_PRODUCTS . " p
    ON op.products_id = p.products_id
    WHERE orders_id = '" . (int)$order_id . "'
    order by op.products_model ASC");
    and voila.. can't thank you enough..
    Debbie D
    NY & VA

  8. #8
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Smile Re: Sort order & Packing list by item number

    Don't forget to "Thank" people properly for their help!!

    Click the in the bottom right hand corner of the message.


    Regards,
    pgmarshall
    _______________________________

  9. #9
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: Sort order & Packing list by item number

    or the <img src=http://www.oscmax.com/forums/images/buttons/reputation.gif> on top of the message. Or if it was real real useful, both of them!
    so endith the lesson
    <think>sometimes I just sit's and thinks</think>
    "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB

Similar Threads

  1. Invoice/Packing Slip sort by product ID
    By wkdwich in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 08-20-2009, 08:46 AM
  2. Add date and order number to invoice and packing slip
    By michael_s in forum New osCommerce Contributions
    Replies: 1
    Last Post: 10-21-2008, 05:15 PM
  3. Order number in Admin Orders List
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 10-13-2008, 12:00 PM
  4. Add date and order number to invoice and packing slip
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 02-13-2007, 10:11 AM
  5. Empty Packing List
    By torweb in forum osCMax v2 Features Discussion
    Replies: 3
    Last Post: 06-14-2006, 09:20 AM

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
  •