Re: display the total weight on the view cart page
Quote:
In /shipping/shipping.php, add: Code:
$smarty->assign("total_weight_shipping_valid", $total_weight_shipping_valid); Code:
$total_weight_shipping_valid = func_weight_shipping_products($cart['products'], true, $all_products_free_shipping, false); Then, to call this simply edit /skin1/customer/main/cart_totals.tpl and place this wherever you want to show it: Code:
{$total_weight_shipping_valid} |
Re: display the total weight on the view cart page
Nice one. For anyone intrested in layout I added this to skin1/main.css
Code:
.totals .total-wt { and used it this way in cart_totals.tpl (around line 191) Code:
the"g" is for grams BTW since I was too lazy to edit languages and put in a nice label, although I did for lbl_totalwt which you can do or just type in the text you want. Vixnfox |
Re: display the total weight on the view cart page
Hey vixnfox,
I didn't even add anything to the CSS layout. I just added this: Code:
<tr> |
Re: display the total weight on the view cart page
Any idea on how this can be achieved using XC v4.4.x?
Many Thanks |
Re: display the total weight on the view cart page
Quote:
To do this in 4.4.x - follow the previous instructions for 4.3.x, but instead of: shipping/shipping.php you need to be in: include/func/func.shipping.php |
Re: display the total weight on the view cart page
Thanks to everyone who contributed to the solution. I made a couple slight changes to accomplish this in 4.5.x using One Page Checkout.
In /shipping/shipping.php add Code:
$smarty->assign("total_weight_shipping_valid", $total_weight_shipping_valid); Code:
$total_weight_shipping_valid = func_weight_shipping_products($cart['products'], true, $all_products_free_shipping, false); I called it on /skin/common_files/modules/One_Page_Checkout/Summary/cart_totals.tpl by just inserting a row where I wanted it to display. Code:
<tr> |
Re: display the total weight on the view cart page
I'm struggling to get this to work on version 4.5.1. The file which includes the PHP code to amend is actually include/func/func.shipping.php, and I have done the following:
PHP Code:
And on the cart.tpl I have included this: HTML Code:
{$total_weight_shipping_valid} However nothing shows up. Any thoughts? |
Re: display the total weight on the view cart page
Are you wrapping your call in anything? If I take it out of the table, it does not display.
|
Re: display the total weight on the view cart page
Quote:
Do you mean the smarty code? I'm including it in the Cart template near the "Checkout" button at the moment, but my final intention is to do an if statement see if total weight is over 12, if not, then include a disabled Checkout button (since weight must be over 12 to proceed). |
Re: display the total weight on the view cart page
My bad, I thought you wanted to display information. I did something a while back that disabled specific shipping options based on extra field values of cart contents, but I really don't remember the details. I'm sure I found the instructions on the forum, it may help point you in the right direction.
If your only requirement is order total must be over 12 lbs, you could just set the minimum value on shipping options at 12 lbs and change the error label to read something like "Your order must be at least ..." The customer would not be able to check proceed without selecting a shipping method. If you did that, you may want to include the weight in the cart display. |
All times are GMT -8. The time now is 07:56 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.