Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Sep 2008
    Posts
    98
    Plugin Contributions
    0

    Default Include Total Number of Items Purchased in Packing Slip

    I would like to include the total number of items purchased as part of the packing slip. This information is included in the shopping cart:

    PHP Code:
    $totalsDisplay TEXT_TOTAL_ITEMS $_SESSION['cart']->count_contents() . $item_separator TEXT_TOTAL_WEIGHT $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT $item_separator TEXT_TOTAL_AMOUNT $currencies->format($_SESSION['cart']->show_total()); 
    However that information is dropped for the invoice and packing slip. Can anyone tell me how to get (just the quantity part) to appear in the packing slip?

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Inclued Total Number of Items Purchased in Packing Slip

    If you just want the number of line-items (regardless of quantity selected on each line), simply echo out the value of:
    Code:
    sizeof($order->products)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2008
    Posts
    98
    Plugin Contributions
    0

    Default Re: Inclued Total Number of Items Purchased in Packing Slip

    Yes..many thanks....that works for those situations where a customer has ordered one of each item and is a big help for most circumstances....Is there also a way to have it reflect the total number of items purchased where the customer may have ordered more than one of certain items?

    Also just to be clear for others who are looking at this thread, here is what I did:

    In admin/includes/languages/english/packingslip.php I added a line:

    PHP Code:
    define('ITEMS_PURCHASED''Number of Items Ordered:'); 
    In admin/packingslip.php I added the following after similar language showing the payment method so that the number of items would show just below that information in the packing slip:

    PHP Code:
    <tr>
            <td class="main"><strong><?php echo ITEMS_PURCHASED?></strong></td>
            <td class="main"><?php echo sizeof($order->products); ?></td>
          </tr>

  4. #4
    Join Date
    Sep 2008
    Posts
    98
    Plugin Contributions
    0

    Default Re: Inclued Total Number of Items Purchased in Packing Slip

    By the way...is there a way to edit the title of this thread so that I can correct the typo where it reads: "Inclued" instead of "Include"?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Inclued Total Number of Items Purchased in Packing Slip

    You could try using this PHP code to prepare a different variable to display:
    Code:
       $qtyDisplay = 0;
       for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         $qtyDisplay += ($order->products[$i]['qty']);
       }
       echo $qtyDisplay;
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Sep 2008
    Posts
    98
    Plugin Contributions
    0

    Default Re: Include Total Number of Items Purchased in Packing Slip

    Yes...that did the trick...Thanks again...and also thanks for correcting my typo in the Title.

  7. #7
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Include Total Number of Items Purchased in Packing Slip

    I've been trying to use this code on the checkout_success page, but had no luck so far.

    Would someone be able to point me in the right direction as to where the code needs to be placed please?

    Many thanks,

    Alex

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Include Total Number of Items Purchased in Packing Slip

    This thread is discussing alterations to the Packing Slip.

    What exactly are you wanting to do to the checkout-success page and why?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Include Total Number of Items Purchased in Packing Slip

    I needed to get the total number of items purchased to display on the checkout_success page. This is required for some JavaScript conversion code that I'm using.

    A simple SQL query helped and I've included my code below to assist others.

    Code:
    $ac_total_items = $db->Execute('SELECT SUM(products_quantity) FROM ' . TABLE_ORDERS_PRODUCTS . ' WHERE orders_id = ' . $zv_orders_id);
    $ac_total_items = $ac_total_items->fields['SUM(products_quantity)'];

    The $ac_total_items variable can now be used to display the total number of products ordered (it also takes into account multiple quantities).

  10. #10
    Join Date
    Jun 2009
    Location
    Des Moines, Iowa USA
    Posts
    609
    Plugin Contributions
    0

    Default Re: Include Total Number of Items Purchased in Packing Slip

    Can you include exactly where the coding in posting #9 and #5 should be included for those uf us who are newbies?

    what fiels and where within these files?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Number of thumbnails on packing slip
    By DML73 in forum General Questions
    Replies: 1
    Last Post: 10 Dec 2013, 01:06 PM
  2. v139g Not show Model number on packing slip?
    By xandros2000 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 9 May 2013, 06:20 PM
  3. Quanity discount for total items purchased
    By msebar in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 16 Dec 2010, 05:41 AM
  4. Order number barcode on packing slip
    By harry2cool in forum General Questions
    Replies: 0
    Last Post: 12 Sep 2008, 08:04 PM
  5. Packing Slip to Dropship Slip
    By PaintBall in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 28 Oct 2007, 12:10 AM

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