Forums / Managing Customers and Orders / Putting Weight into packing slip

Putting Weight into packing slip

Locked

Views: 1,456

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
5 Nov 2010, 9:18 PM
#1
pbaerveldt avatar

pbaerveldt

New Zenner

Join Date:
Nov 2010
Posts:
4
Plugin Contributions:
0

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/showthread.php?p=401311#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 :laugh:

5 Nov 2010, 9:37 PM
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

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 :cry::cry::cry:

If you come by the awnser please let me know

6 Nov 2010, 2:19 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!

8 Nov 2010, 2:16 PM
#4
pbaerveldt avatar

pbaerveldt

New Zenner

Join Date:
Nov 2010
Posts:
4
Plugin Contributions:
0

Re: Putting Weight into packing slip

Ajeh:

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. :laugh:

8 Nov 2010, 3:12 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!

8 Nov 2010, 3:45 PM
#6
pbaerveldt avatar

pbaerveldt

New Zenner

Join Date:
Nov 2010
Posts:
4
Plugin Contributions:
0

Re: Putting Weight into packing slip

Ajeh:

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?

 <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'] . ' 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> <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";
8 Nov 2010, 5:53 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Putting Weight into packing slip

Example, find in that section of code the:

$order->products[$i]['name']

Change to read:

$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 Nov 2010, 8:07 PM
#8
pbaerveldt avatar

pbaerveldt

New Zenner

Join Date:
Nov 2010
Posts:
4
Plugin Contributions:
0

Re: Putting Weight into packing slip

Ajeh:

Example, find in that section of code the:

$order->products[$i]['name']

> 
> Change to read:
> ```
$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 ```
$order->products[$i]['name'][COLOR="Red"] . ' - ' . zen_products_lookup($order->products[$i]['id'], 'products_weight');