Hi iam havin some difficulties with my site, when you add a product to your shoppin cart it shows the weight as 11g but should be 109g and for some strange reason it keeps rounding the figures up and not showing the 3 figures it should
ie product weighs 0.109g but when in admin or cart it only reads 0.11g so shipping not working properly.
i have tried looking files to find the answer but now going insane.
have set site to g for weight and localisation to kg1.000 and g to 0.001 (and have tried 0.01).
any advice would be greatly welcome as this is the only thing now stopping us to adding our products
many thanks
john
ie product weighs 0.109g but when in admin or cart it only reads 0.11g so shipping not working properly.
i have tried looking files to find the answer but now going insane.
have set site to g for weight and localisation to kg1.000 and g to 0.001 (and have tried 0.01).
any advice would be greatly welcome as this is the only thing now stopping us to adding our products
many thanks
john
Hey John,
In system / library / weight.php
Find:
Change To:
And that should fix your problem.
Regards,
Joel.
In system / library / weight.php
Find:
Code: Select all
return number_format($value, 2, $decimal_point, $thousand_point) . $this->weights[$weight_class_id]['unit'];
} else {
return number_format($value, 2, $decimal_point, $thousand_point);
Code: Select all
return number_format($value, 3, $decimal_point, $thousand_point) . $this->weights[$weight_class_id]['unit'];
} else {
return number_format($value, 3, $decimal_point, $thousand_point);
Regards,
Joel.
Hey Joel
thats awsome have been looking for this for what felt like an eternity.
Now my wife will be pleased as this is her site and after being messed by a few people we are going it alone.
Thanks again and will let people know if they also get the same problem.
Its also good to know that there is still some honest and genuine people out there cheers
john
thats awsome have been looking for this for what felt like an eternity.
Now my wife will be pleased as this is her site and after being messed by a few people we are going it alone.
Thanks again and will let people know if they also get the same problem.
Its also good to know that there is still some honest and genuine people out there cheers
john
I am a newbie with open cart and having problems with this too, I added the code but it doesn't seem to be changing the outcome, just seems to do my head in by going around in circles
Hope someone can see what I am doing wrong...
I am wanting to use grams up and up to kilograms, we sell per metre - webbing, we have one that weighs 45grams per metre but it keeps rounding to 50grams, so when you buy say 100 metres it should be 4.5kg weight but instead it will be 5kg?
I am entering it to product like this 0.045
then it changes to 0.05
It doesn't seem to matter whether I use grams or kg the end result is the same.
Then to top it off if I go through the checkout selecting 100 metres it shows the shipping option of "standard" that I set up that only goes to 3kg and yet it clearly says in checkout the weight is 5kg?
I have Version 1.5.1.3
Hope someone can see what I am doing wrong...
I am wanting to use grams up and up to kilograms, we sell per metre - webbing, we have one that weighs 45grams per metre but it keeps rounding to 50grams, so when you buy say 100 metres it should be 4.5kg weight but instead it will be 5kg?
I am entering it to product like this 0.045
then it changes to 0.05
It doesn't seem to matter whether I use grams or kg the end result is the same.
Then to top it off if I go through the checkout selecting 100 metres it shows the shipping option of "standard" that I set up that only goes to 3kg and yet it clearly says in checkout the weight is 5kg?
I have Version 1.5.1.3
Anita
Had similar problem. I set my global shop weight to grams. Then each product set to grams. Then enter each product weight as grams ie 45 (not 0.045kg). Along with the code in above post & all seems to be calculating correctly.
hope this helps, im a noobie too & just starting to get into it.
good luck
Steve.....
hope this helps, im a noobie too & just starting to get into it.
good luck
Steve.....
Hi Steve,
Thank you for your reply.
I tried what you have done but unfortunately it isn't working, the 45 grams comes up as 45kg when a large order goes through then when I go back to have a look it says 45.00.
I have searched high and low on the boards and google, for nearly 12 hours I am trying to figure this out, still no closer
Thank you for your reply.
I tried what you have done but unfortunately it isn't working, the 45 grams comes up as 45kg when a large order goes through then when I go back to have a look it says 45.00.
I have searched high and low on the boards and google, for nearly 12 hours I am trying to figure this out, still no closer
Anita
The weight system does work! Honest!HorseMagic wrote: I tried what you have done but unfortunately it isn't working, the 45 grams comes up as 45kg when a large order goes through then when I go back to have a look it says 45.00.
Changing the number of decimal points as in previous postings should help resolve rounding issues - but to enter one unit of weight and then display another you have to make sure that both the global weight setting is correct AND the options within the individual store are set to the same.
1. Is your Admin > System > Localisation > Weight classes set properly (with '1' in which unit you choose as default)
2. Is your Admin > System > Settings > Your Store > Local tab set to the same units?
Genuine, Honest Opencart Support @ http://webvetservices.com
Many thanks for your help...
This may be where the problem lies, yes i have this set same as the next one you mention however it is doing grams and kilograms as default, I can't change either of them so they both say 1.00000000, I have tried to change this around but both keep defaulting to same.
I have tried all sorts of different settings, I have a log of errors which I have found only one other person to have similar and they post on OpenCart 1.5.1.3 Bug Thread, I couldn't see a fix for it, I have asked late last night or was it early hours this morning, hoping for reply.
I believe you but I am beginning to think if your not a coder or very technical type then getting opencart to work is not going to happen any time soon.The weight system does work! Honest!
No it didn'tChanging the number of decimal points as in previous postings should help resolve rounding issues
1. Is your Admin > System > Localisation > Weight classes set properly (with '1' in which unit you choose as default)
2. Is your Admin > System > Settings > Your Store > Local tab set to the same units?
This may be where the problem lies, yes i have this set same as the next one you mention however it is doing grams and kilograms as default, I can't change either of them so they both say 1.00000000, I have tried to change this around but both keep defaulting to same.
I have tried all sorts of different settings, I have a log of errors which I have found only one other person to have similar and they post on OpenCart 1.5.1.3 Bug Thread, I couldn't see a fix for it, I have asked late last night or was it early hours this morning, hoping for reply.
Anita
OMG You are awesome Joel, thank you so much for all your help, and special thanks for your time and patience to teach.
What can I say but Amazing Guy
What can I say but Amazing Guy
Anita
HorseMagic wrote:Many thanks for your help...
I believe you but I am beginning to think if your not a coder or very technical type then getting opencart to work is not going to happen any time soon.The weight system does work! Honest!
No it didn'tChanging the number of decimal points as in previous postings should help resolve rounding issues
1. Is your Admin > System > Localisation > Weight classes set properly (with '1' in which unit you choose as default)
2. Is your Admin > System > Settings > Your Store > Local tab set to the same units?
This may be where the problem lies, yes i have this set same as the next one you mention however it is doing grams and kilograms as default, I can't change either of them so they both say 1.00000000, I have tried to change this around but both keep defaulting to same.
I have tried all sorts of different settings, I have a log of errors which I have found only one other person to have similar and they post on OpenCart 1.5.1.3 Bug Thread, I couldn't see a fix for it, I have asked late last night or was it early hours this morning, hoping for reply.
I'm having the same kind of weight issue. My products range from 1g - 11g each. The fedex mod i'm using requires the system to run in lbs so i have all the products set in lbs as well. Seems that the rounding issue is my problem but when I tried the decimal fix above i get the same results (it only saves weights at two decimal places ex. 0.01). All my system weights are set to 1.00000. The rate starts doubling or more as i add more items but i'm only adding items that weigh grams not pounds... Well maybe not since it seems i can't enter more than two decimal spots. I'm hoping someone can assist me so I'm not spending hours working on this tomorrow.
Any ideas?
Thank you in advance!
Go to your phpMyAdmin site, and select the 'Product' table.cnees wrote: Well maybe not since it seems i can't enter more than two decimal spots. I'm hoping someone can assist me so I'm not spending hours working on this tomorrow.
Any ideas?
Thank you in advance!
Find the 'Weight' field, and edit the length (set to 5,2 by default) and increase it to 5,3 or 5,4 depending on how many decimal points you require. See what effect this has on your problem.
Genuine, Honest Opencart Support @ http://webvetservices.com
Well for me I thought I had it correct but I did not have it set to grams in store settings which I think is where it messed up my grams and kilograms, both went value = 1.0000,.I'm having the same kind of weight issue. My products range from 1g - 11g each. The fedex mod i'm using requires the system to run in lbs so i have all the products set in lbs as well. Seems that the rounding issue is my problem but when I tried the decimal fix above i get the same results (it only saves weights at two decimal places ex. 0.01). All my system weights are set to 1.00000. The rate starts doubling or more as i add more items but i'm only adding items that weigh grams not pounds... Well maybe not since it seems i can't enter more than two decimal spots. I'm hoping someone can assist me so I'm not spending hours working on this tomorrow.
Any ideas?
Thank you in advance!
Once I had my settings changed correctly it went as below which it should have been.
g - value = 1.0000
kg - value = 0.001
The other thing I had wrong was I had ' , ' at the beginning and end of each sets of rates which totally messed it up. Joel helped me heaps
Anita
OpenCart Addons wrote:Hey John,
In system / library / weight.php
Find:Change To:Code: Select all
return number_format($value, 2, $decimal_point, $thousand_point) . $this->weights[$weight_class_id]['unit']; } else { return number_format($value, 2, $decimal_point, $thousand_point);
And that should fix your problem.Code: Select all
return number_format($value, 3, $decimal_point, $thousand_point) . $this->weights[$weight_class_id]['unit']; } else { return number_format($value, 3, $decimal_point, $thousand_point);
Regards,
Joel.
I just want to say thank you for being so helpful.
outoftheordinary
I am having this same issue. I have checked all my weight settings as described above. But still no joy. So I guess I have to make the changes to weight.php
I'm a newbie, so please excuse my ignorance.
If I edit weight.php and then upgrade won't the changes be overwritten?
I have vqmod installed which I understood was to stop this happening, but I have no idea how to use it to edit this script safely.
Any help would be much appreciated. Using version 1.5.5.1
I'm a newbie, so please excuse my ignorance.
If I edit weight.php and then upgrade won't the changes be overwritten?
I have vqmod installed which I understood was to stop this happening, but I have no idea how to use it to edit this script safely.
Any help would be much appreciated. Using version 1.5.5.1
santura
If you edit the weight.php file directly then it will be overwritten during an upgrade.
If you want to use vQmod to make the change for you, it will need a vQmod (xml file) to make the changes on-the-fly. This will leave your core weight.php untouched, and (assuming the lines of code exist after an upgrade) the vQmod should still work.
Hope that makes sense?
If you edit the weight.php file directly then it will be overwritten during an upgrade.
If you want to use vQmod to make the change for you, it will need a vQmod (xml file) to make the changes on-the-fly. This will leave your core weight.php untouched, and (assuming the lines of code exist after an upgrade) the vQmod should still work.
Hope that makes sense?
Genuine, Honest Opencart Support @ http://webvetservices.com
santura - I'll upload the vQmod for you later on this thread, just let me know if you are playing around and figure it out first (unfortunately I am busy for the next few hours)...
Genuine, Honest Opencart Support @ http://webvetservices.com
Ok - I haven't changed anything from Joel from OpenCart AddOns in earlier posts (so no credit at all to me!) but just put it into an .xml file for use as a vQmod:
Just upload into your 'vqmod/xml' folder and it should work fine. Increases the number of digits after the decimal point from 2 to 3 in the shopping cart page.
Let me know if any problems - I have checked it in my v1.5.4.1 site and appears to work fine.
Just upload into your 'vqmod/xml' folder and it should work fine. Increases the number of digits after the decimal point from 2 to 3 in the shopping cart page.
Let me know if any problems - I have checked it in my v1.5.4.1 site and appears to work fine.
Genuine, Honest Opencart Support @ http://webvetservices.com
Who is online
Users browsing this forum: No registered users and 94 guests