Add weight in checkout page

Add weight in checkout page

Postby info@.....com » Wed Sep 28, 2011 11:49 pm

Hi all, i want to add the total weight of the order into the checkout page.
How can I do it?

Thanks ;)
info@.....com
 
Posts: 1
Joined: Wed Sep 28, 2011 11:47 pm

Re: Add weight in checkout page

Postby admin » Wed Oct 05, 2011 12:05 pm

Hello Nicola,
which part of you checkout (shipping, paymen, coupons, cart) uses the
weight? My component uses $weight as global variable and sends it to
the shipping methods. The weight is counted in basket.php file (which
is my version of the file).

How does it work
- basket.php in the main process counts weight per each basket item and sums it
- it creates a global javascript variable op_weight and sends it with
onepage.js to ajax handler (/components/com_onepage/ajax/shipping.php)
- it this than saved into global php variable and POST ($d) and sent
to the shipping options

If you provide me a link for you modification, i can give you more
hints on this.

If you only need to modify how the product looks in the cart, you can
do it either in basket.html.php file in OPC templates or directly in
basket.php which generates the code for products in the cart.

thanks for the fast reply! :-)
I only need to show at the end of the basket the total weight of the order. I've edited basket.html.php and added a new <tr> with echo $weight_total, but doesn't work.


hello, please try to init it with a global variable like
$GLOBALS['weight_total'] or $GLOBALS['weight']

With the Global variable works ;-)
Thanks for the help.

Have a good day,
Nicola
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 1.1.x