Skip to main content

weight calculator/show weight of products in cart

More
13 years 9 months ago #83551 by itye2012
thanks for the reply , sorry its working now ,was a while since i changed it and realised you need to add the code in between <?php and ?>

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #83557 by itye2012
actually is it possible to add additional weight onto the total weight shown in cart by the code above. For example the weight shown by the code above is a total weight of all the products, however I need to add the weight of the packaging onto the final weight figure used to calculate the shipping

how can i do this?

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #83559 by Mohamed Thelji
Hi again,

If the weight of your packaging is 6 for example, the code that you'll need to add will be :
Code:
$cartClass = hikashop_get('class.cart'); $cart = $cartClass->loadFullCart(true); $final_weight = $cart->weight + 6; echo $final_weight;

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #84082 by itye2012
thanks for that , where do i need to place this code?

Many Thanks

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #84360 by Xavier
Hi,

I think that you will have to add the code in the plugin file of your payment methods (plugins\hikashopshipping\methodname.php), in the function "onShippingDisplay()"
Some PHP knowledge are required.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #93182 by MikeC
I have this working, but my weight shows up in Kilograms instead of pounds. For instance one of my products weighs 4 pounds, but shows up as 1.81436948 KG. Is there a way to change this?

Thank You

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #93290 by nicolas
What is working ?
Several different things have been posted on that thread so I don't know about which one you're talking.
If you're using pounds and that you see a weight in KG, it's probably because your main weight unit in the configuration is KG and not the pound. Change that and that should display you the weights in pound (the first one of the units in the list is the main one).
The following user(s) said Thank You: MikeC

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #93314 by MikeC
Sorry....

I entered this text to display the weights in checkout:
Code:
echo $row->product_weight;

You say the "main weight unit in the configuration". I have looked all over for the setting for this. Can you point me in the right direction?

Thank you

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #93477 by nicolas
It's at the bottom of the main tab of the configuration
The following user(s) said Thank You: MikeC

Please Log in or Create an account to join the conversation.

Time to create page: 0.240 seconds
Powered by Kunena Forum