Hi;
On 1.0.8.14 on a default install-
When I try to add shipping method via zone.php ;
It always displays weight as 0lb and always displays the base rate on checkout..... irrelevant of the weight of the items in the cart.
My Package Tare Weight =0 in settings.
When I change it to any other number like 3--- then zone.php shows the weight as 3lb then and relevant price - but the weight of the product is not calculated or displayed.
Please help me fix the issue dear;
Very Warm Regds./
radhavallabh
Shipping Weight Error
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Shipping Weight Error
Hi;
I checked again it seems the shipping-weight is rounding up to nearest integer which ends up for weight below 1lb items to 0...
Can we switch off the rounding of shipping weight??
Regds./
radhavallabh
I checked again it seems the shipping-weight is rounding up to nearest integer which ends up for weight below 1lb items to 0...
Can we switch off the rounding of shipping weight??
Regds./
radhavallabh
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Shipping Weight Error
As best I can see, it only does that when the shipping weight of the order is greater than the maximum box weight.
Of course, the problem that you describe is not with rounding up to the nearest integer but with rounding down. Perhaps: https://github.com/CE-PhoenixCart/Phoen ... es.php#L15 (try changing the %d to %f; your language may not be English).
When I try this with the demo products, it works as expected. If it's not working for you, you need to figure out what about it is not working:
1. It's not calculating the shipping correctly.
2. It's not displaying the correct weight.
That's two different problems. You may have both.
For either, I would need to know what the weight of the product is and what quantity is in the cart. I would need to know any changes that you made to admin > Configuration > Shipping from the default values.
For not calculating the shipping correctly, I would need to know what the zone table is.
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Shipping Weight Error
Thank you so much dear for your reply-ecartz wrote: ↑Mon May 09, 2022 9:27 amAs best I can see, it only does that when the shipping weight of the order is greater than the maximum box weight.
Of course, the problem that you describe is not with rounding up to the nearest integer but with rounding down. Perhaps: https://github.com/CE-PhoenixCart/Phoen ... es.php#L15 (try changing the %d to %f; your language may not be English).
When I try this with the demo products, it works as expected. If it's not working for you, you need to figure out what about it is not working:
1. It's not calculating the shipping correctly.
2. It's not displaying the correct weight.
That's two different problems. You may have both.
For either, I would need to know what the weight of the product is and what quantity is in the cart. I would need to know any changes that you made to admin > Configuration > Shipping from the default values.
For not calculating the shipping correctly, I would need to know what the zone table is.
Yes rounding down was the issue and the fix worked perfectly! Now it works as expected dear!!
Another issue dear...
But Now I get for example Shipping to GB : 1.600000 lb(s) on the product -- dear please can you guide on how to remove the 00000 at the end of it.
Thank you so much for helping me with this!!!
Very Warm Regds./
radhavallabh
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Shipping Weight Error
Using %s instead fixed the trailing 0000 issue dearradhavallabh wrote: ↑Mon May 09, 2022 10:50 amThank you so much dear for your reply-ecartz wrote: ↑Mon May 09, 2022 9:27 amAs best I can see, it only does that when the shipping weight of the order is greater than the maximum box weight.
Of course, the problem that you describe is not with rounding up to the nearest integer but with rounding down. Perhaps: https://github.com/CE-PhoenixCart/Phoen ... es.php#L15 (try changing the %d to %f; your language may not be English).
When I try this with the demo products, it works as expected. If it's not working for you, you need to figure out what about it is not working:
1. It's not calculating the shipping correctly.
2. It's not displaying the correct weight.
That's two different problems. You may have both.
For either, I would need to know what the weight of the product is and what quantity is in the cart. I would need to know any changes that you made to admin > Configuration > Shipping from the default values.
For not calculating the shipping correctly, I would need to know what the zone table is.
Yes rounding down was the issue and the fix worked perfectly! Now it works as expected dear!!
Another issue dear...
But Now I get for example Shipping to GB : 1.600000 lb(s) on the product -- dear please can you guide on how to remove the 00000 at the end of it.
Thank you so much for helping me with this!!!
Very Warm Regds./
radhavallabh
Thank you again!!
Very Warm Regds./
radhavallabh
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Shipping Weight Error
Thank you so much again dear!! Now Works as wanted!ecartz wrote: ↑Mon May 09, 2022 11:32 am Try %.2f
Documentation: https://www.php.net/manual/en/function.sprintf.php
Very Warm Regds./
radhavallabh