- Posts: 115
- Thank you received: 0
weight calculator/show weight of products in cart
13 years 9 months ago #83551
by itye2012
Replied by itye2012 on topic weight calculator/show weight of products in cart
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.
13 years 9 months ago #83557
by itye2012
Replied by itye2012 on topic weight calculator/show weight of products in cart
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?
how can i do this?
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 9 months ago #83559
by Mohamed Thelji
Replied by Mohamed Thelji on topic weight calculator/show weight of products in cart
Hi again,
If the weight of your packaging is 6 for example, the code that you'll need to add will be :
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.
13 years 9 months ago #84082
by itye2012
Replied by itye2012 on topic weight calculator/show weight of products in cart
thanks for that , where do i need to place this code?
Many Thanks
Many Thanks
Please Log in or Create an account to join the conversation.
13 years 9 months ago #84360
by Xavier
Replied by Xavier on topic weight calculator/show weight of products in cart
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.
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.
13 years 7 months ago #93182
by MikeC
Replied by MikeC on topic weight calculator/show weight of products in cart
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
Thank You
Please Log in or Create an account to join the conversation.
13 years 7 months ago #93290
by nicolas
Replied by nicolas on topic weight calculator/show weight of products in cart
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).
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.
13 years 7 months ago #93314
by MikeC
Replied by MikeC on topic weight calculator/show weight of products in cart
Sorry....
I entered this text to display the weights in checkout:
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
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.
13 years 7 months ago #93477
by nicolas
Replied by nicolas on topic weight calculator/show weight of products in cart
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