Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Idea or Suggestion Putting Weight into packing slip

    currently running Zen Cart 1.3.8a

    I'm looking for a way to add in the weight of each item into the packing slip.

    i have used this method to add in to other field ( http://www.zen-cart.com/forum/showth...311#post401311 manufacture and description)

    But i am unable to get it to work with weight. I'm not that familiar with PHP, in fact it took me all day just to get one of these working, ive managed to get both working now its just once i put in the all the code it stops working and i get a http 500, but i can remove the code and it goes back to working so my guess is that when i try to run a zen_get_products_weight that im not finding any of the weight's for the items.

    if someone could please enlighten me as to how i could gather that information? the weights shouldn't change (unless we see one on a packing slip thats wrong) but i can update that in the catalog if need be.

    I started reading about maybe doing a post or get of the weights based on the product id and having it put it into the table on the packing slip but as i pointed out earlier im not very php literate so please bear with me

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

    Default Re: Putting Weight into packing slip

    there are some other posts about this topic, but nobody seems to be interested in the product weight on the packing slip

    If you come by the awnser please let me know

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

    Default Re: Putting Weight into packing slip

    The individual Product Weight is not saved with the orders_products table ...

    You would need to look that up per Product on the premise that the Product still exists in the products table ... meaning if the Product gets deleted obtaining the products_weight will not work ...
    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!]
    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!

  4. #4
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: Putting Weight into packing slip

    Quote Originally Posted by Ajeh View Post
    The individual Product Weight is not saved with the orders_products table ...

    You would need to look that up per Product on the premise that the Product still exists in the products table ... meaning if the Product gets deleted obtaining the products_weight will not work ...
    i have searhed the forums for the last week trying different things, i don't see any reason we would need to delete any items in the future since our POS system has to match with the website its better to keep adding new products in order to keep the item#'s the same.

    i couldn't image it being to hard to accomplish this, however i do not have enough experience to code it.

    i would imagine someone out there could think of a solution. i will keep trying but i fear i may break the site one of these times testing out the shopping cart everytime i make a change.

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

    Default Re: Putting Weight into packing slip

    You can pull any field from the products table with the function zen_products_lookup, for example:
    zen_products_lookup($product_id, 'products_weight')

    for the $products_id ... I believe you should be able to use:
    $order->products[$i]['id']

    You may need to experiment with this a bit, I have not tried it ...
    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!]
    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
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: Putting Weight into packing slip

    Quote Originally Posted by Ajeh View Post
    You can pull any field from the products table with the function zen_products_lookup, for example:
    zen_products_lookup($product_id, 'products_weight')

    for the $products_id ... I believe you should be able to use:
    $order->products[$i]['id']

    You may need to experiment with this a bit, I have not tried it ...
    so my guess is that i need to add something in between here in the packingslip.php code?

    PHP Code:
     <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr class="dataTableHeadingRow">
            <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS?></td>
            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL?></td>
            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MANUFACTURER?></td>
            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_DESCRIPTION?></td>
            
          </tr>
    <?php
        
    for ($i=0$n=sizeof($order->products); $i<$n$i++) {
          echo 
    '      <tr class="dataTableRow">' "\n" .
               
    '        <td class="dataTableContent" valign="top" align="right">' $order->products[$i]['qty'] . '&nbsp;x</td>' "\n" .
               
    '        <td class="dataTableContent" valign="top">' $order->products[$i]['name'];

          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'] . ': ' nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
              echo 
    '</i></small></nobr>';
            }
          }

          echo 
    '        </td>' "\n" .
               
    '        <td class="dataTableContent" valign="top">' $order->products[$i]['model'] . '</td>' "\n" .
               
    '        <td class="dataTableContent" valign="top">' $order->products[$i]['manufacturer'] . '</td>' "\n" .        
               
    '        <td class="dataTableContent" valign="top">' $order->products[$i]['description'] . '</td>' "\n" .
                  
               
    '      </tr>' "\n";

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

    Default Re: Putting Weight into packing slip

    Example, find in that section of code the:
    Code:
    $order->products[$i]['name']
    Change to read:
    Code:
    $order->products[$i]['name'] . ' - ' .  zen_products_lookup($order->products[$i]['id'], 'products_weight')
    Now you will see the Product Name - Product Weight on each Product ...
    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!]
    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!

  8. #8
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: Putting Weight into packing slip

    Quote Originally Posted by Ajeh View Post
    Example, find in that section of code the:
    Code:
    $order->products[$i]['name']
    Change to read:
    Code:
    $order->products[$i]['name'] . ' - ' .  zen_products_lookup($order->products[$i]['id'], 'products_weight')
    Now you will see the Product Name - Product Weight on each Product ...
    SWEET! thank you very much linda, you are the best!

    i will change the title name so it reads products/weight to make it easy to read. the only thing that was missing was the semicolon ; at the end of the code
    Code:
     $order->products[$i]['name'][COLOR="Red"] . ' - ' .  zen_products_lookup($order->products[$i]['id'], 'products_weight');

 

 

Similar Threads

  1. Show shipping weight on invoice or packing slip?
    By raspberryjamcloth in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 21 Dec 2008, 10:24 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

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