danthman Posted October 20, 2008 Posted October 20, 2008 I want to use flat weight shipping but would like the shipping weight shown on the invoice or packing slip like the UPS module does. I have searched the contributions but cannot find anything that applies. Does anyone know how I can add this feature? Thanks, Dan
chrish123 Posted October 20, 2008 Posted October 20, 2008 I want to use flat weight shipping but would like the shipping weight shown on the invoice or packing slip like the UPS module does. I have searched the contributions but cannot find anything that applies. Does anyone know how I can add this feature? Thanks, Dan You can use chris23 's PDF customer invoice addon http://www.oscommerce.com/community/contributions,5321 forum here ( http://www.oscommerce.com/forums/index.php?showtopic=271214 ) Use the pdf packing slip addon after which shows weight on the packing slip, and to add the weight after to the invoice and anywhere else simply place this code on your invoice under: include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); ADD AFTER: <?php // Now work out totals for line count, item count and total weight: $lines = sizeof($order->products); $weight = 0; $items = 0; for ($i = 0; $i < $lines; $i++) { $weight += ($order->products[$i]['products_weight'] * $order->products[$i]['qty']); $items += $order->products[$i]['qty']; } ?> And then to display the weight find a good place for this: <?php echo ('<b>Total Weight:</b> ') . '<font color=red><b>' . number_format($weight,2) . ' </b></font><b>KG</b>'; ?> Not sure but you maybe able to skip the first step (installing the pdf customer invoice and pdf packing slip addon with weight) try the above code I use it and it works fine but i did borrow it from chris23's addon.
danthman Posted October 20, 2008 Author Posted October 20, 2008 You can use chris23 's PDF customer invoice addon http://www.oscommerce.com/community/contributions,5321 forum here ( http://www.oscommerce.com/forums/index.php?showtopic=271214 ) Use the pdf packing slip addon after which shows weight on the packing slip, and to add the weight after to the invoice and anywhere else simply place this code on your invoice under: include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); ADD AFTER: <?php // Now work out totals for line count, item count and total weight: $lines = sizeof($order->products); $weight = 0; $items = 0; for ($i = 0; $i < $lines; $i++) { $weight += ($order->products[$i]['products_weight'] * $order->products[$i]['qty']); $items += $order->products[$i]['qty']; } ?> And then to display the weight find a good place for this: <?php echo ('<b>Total Weight:</b> ') . '<font color=red><b>' . number_format($weight,2) . ' </b></font><b>KG</b>'; ?> Not sure but you maybe able to skip the first step (installing the pdf customer invoice and pdf packing slip addon with weight) try the above code I use it and it works fine but i did borrow it from chris23's addon. Thanks for the advice, I added the mods and your code and am able to display the total shipping weight but the shipping address has disappeared. When I upload the original admin/includes/classes/order.php the shipping address reappears but of course the weight is now zero. I have modified the original page twice to find errors but still get the same result. What did I do wrong? Dan
Recommended Posts
Archived
This topic is now archived and is closed to further replies.