VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: servlet on October 27, 2013, 09:29:57 AM

Title: Problem with cart weight calculations
Post by: servlet on October 27, 2013, 09:29:57 AM
J! 2.5.14
VM. 2.0.24
PHP 5.3

I found some topics about this problem but there is not solution or there is no any answer.
VM select only first option - the minimum.
There is product weight for each product.
There is different prices for different weight.
I made a lot of tests and I dont know is it a config problem or it is a bug. I think this is not config problem.
Title: Re: Problem with cart weight calculations
Post by: Enriko on October 27, 2013, 16:17:30 PM
Dear servlet,

I had the same issue. I could replicate it and found out a workaround for it. But is should be fixed in total.
To help this on the short term. Is to always have the weight rules in Kilogram for the shipment methods. Then there is no issue with it.


Replication steps:
I first created two products.

1 with the weight in 751 gram
(http://i39.tinypic.com/11v156f.jpg)

1 with the weight in 0.751 KG
(http://i41.tinypic.com/90u4nk.jpg)

Both are the same weight.


After that I created two shipments methods.

1 with the minimal weight of 0.250 KG (NAMED PostNL Brievenbus post 0 - 250 gram)
(http://i42.tinypic.com/2vwxwup.jpg)

1 with the minimal weight of 250 Gram (NAMED PostNL Brievenbus post 0 - 250 gram Copy)
(http://i42.tinypic.com/2nipnd1.jpg)

Both have the same weight break rules. (250 gram)

If I add the product, it doesn't matter which one of the two. Both are stating as weight 751. (
vmdebug getOrderWeight Var1:
751.0000
vmdebug getOrderWeight Var1:
751.0000


But if I check in the vmdebug. Then I see the following:
vmdebug shipmentmethod PostNL Brievenbus post 0 - 250 gram = FALSE for variable weight = 0.751 Reason: is over 0.250
vmdebug shipmentmethod PostNL Brievenbus post 0 - 250 gram Copy = TRUE for variable weight = 0.751 Reason: is lower than the set 250

So the copy, which is filled in as gram. Is not converted to KG. And therefore is possible to load 1000 times more weight.

The bug is in the conversion (or the lack of it) of the shipment methods from Gram to Kilogram
Please let me know if this bug is already known or how we can track this one, to inform others.

Greetings Enriko

J! 2.5.14
VM. 2.0.24
PHP 5.3.27
Title: Re: Problem with cart weight calculations
Post by: servlet on October 27, 2013, 19:48:15 PM
You tell me to create two variants for each product?!?
I have more then 2k products.
Or it is only for tests
If it is only for tests I found it that ... If in product details is set KG dimension in cart is calculated like grams...
This bug may be is so old. I have problems in 20b too...
I dont know how anyone has live site with this problem...
May be something we miss.
Title: Re: Problem with cart weight calculations
Post by: servlet on October 27, 2013, 19:51:20 PM
Did you test to set dimension grams in product details and to set default dimension in Shop - grams? I am not yet
Title: Re: Problem with cart weight calculations
Post by: servlet on November 08, 2013, 13:10:11 PM
Enriko, did you solve the problem? I made a lot of tests but there are no results.
Title: Re: Problem with cart weight calculations
Post by: Enriko on November 08, 2013, 15:12:16 PM
Hi Servlet,

No i didn't do any more tests.

My below analyse is for me clear enough to describe the issue. I don't know what we can do more (without going into the code) to have this solved.

I rather have a developer check into this issue and let them decide if this is a feature or a bug.

Greetings Enriko
Title: Re: Problem with cart weight calculations
Post by: servlet on November 09, 2013, 11:45:53 AM
We will wait...
Thanks for replay
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 15, 2013, 01:41:05 AM
I just tested this on our new vm2.0.24a and it seems fixed.
Title: Re: Problem with cart weight calculations
Post by: servlet on November 15, 2013, 18:47:56 PM
Thanks Milbo
I will test it...
Title: Re: Problem with cart weight calculations
Post by: lode999 on November 15, 2013, 23:02:56 PM
I am using  2.0.24a.. and I have t he same problem... and the latest 2. joomla
shippingmethod is in KG
standard shippingmethod: plugin enebled

My debug says

FALSE for variable weight = 0 while my product has a weight of 5 kg.

I only get 1 shopingmethod (a wrong one) if I set it starting from 0kg.

I am searching for hours on google.. but I find no answers.
Can you help?

Thank You,
Lode
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 16, 2013, 11:16:31 AM
version?
Title: Re: Problem with cart weight calculations
Post by: lode999 on November 16, 2013, 19:04:27 PM
sorry
Joomla 2.5.15

But now I have looked at an other shop I have made.
There  we don't do it with weight...  only  shippingrates for country's.
But the products have a weight filled in.
When I set on the debug for VM I see that the weight of the products is 1.1 kg. Even I change quantity to 100.
So there also the calculation of the weight is not correct.
There the  joomla version is 2.5.14 en the VM 2.0.24
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 16, 2013, 19:55:11 PM
use 2.0.24a !
Title: Re: Problem with cart weight calculations
Post by: lode999 on November 16, 2013, 21:14:19 PM
On the other site in my first post I am using  24a
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 17, 2013, 16:11:40 PM
Did you update the core and the extensions? for a proper answer I need a screenshot of the product edit with the weight,.. a screenshot of the plugin and the vmdebug message. For me it works with different quantities also the calculation of onze and similar
Title: Re: Problem with cart weight calculations
Post by: saviB on November 19, 2013, 21:18:30 PM
version
2.0.24b

Hello Milbo, I believe my issue is either related or is the same. I've been trying to use the existing weight to show volume. I essentially only apply a language overide to make this work for me. However, while trying to get weight to show in invoices, I discovered that Order Weight is A: Incorrect and B: Not increasing with quantity of product.

http://fairpricestudio.com/vm_images/pounds.jpg
http://fairpricestudio.com/vm_images/quantity.jpg
http://fairpricestudio.com/vm_images/order_weight.jpg

I discovered this because I was looking to use OrderWeight to display total weight in invoices. I have yet to be successful. Can you please address the above, and perhaps tell me the variable name for OrderWeight? So, instead of <td align="left"><?php echo $prow->product_weight ?></td> it would be <td align="left"><?php echo $prow->total order weight variable name ?></td>
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 19, 2013, 23:28:50 PM
hmm strange it looks like it it calculates 18 pounds for it, but should be 81, yes? 18 pounds = 8.16466 ~ 8.1647 kilogramm, hmm
Title: Re: Problem with cart weight calculations
Post by: lode999 on November 20, 2013, 12:03:56 PM
In my case:
I have made a new joomla installation inside the maps of my problem site. so that it is in the same environment as my problem site.
Joomla 2.5.16 and the VM 22a.
Sample data for Joomla and the sample data for VM.
Made shippingrules.
Ant it seems to work fine. 

I have no time to try to fix the site, and I am going to move my tables from the database. And made a new site.
Title: Re: Problem with cart weight calculations
Post by: Milbo on November 20, 2013, 12:07:30 PM
lode999 to talk about 2.0.22a is quite useless. you must anyway update asap (at least 2.0.22c), cause it is unsecure. On the other hand, interesting that it worked there. We know it is broken for 2.0.22, cause I fixed the 2.0.24, so we are now only interested in vm2.0.24b.


Quote from: saviB on November 19, 2013, 21:18:30 PM
version
2.0.24b

Hello Milbo, I believe my issue is either related or is the same. I've been trying to use the existing weight to show volume. I essentially only apply a language overide to make this work for me. However, while trying to get weight to show in invoices, I discovered that Order Weight is A: Incorrect and B: Not increasing with quantity of product.

I just tested that stuff with the pounds and all that. First I thought I got a wrong result, because the shipment was set on pounds. Be aware that you have weight units for your products, your store and your shipment method.

For me it works in 2.0.24b perfect
Title: Re: Problem with cart weight calculations
Post by: saviB on November 20, 2013, 16:10:56 PM
I've been making edits to an existing order so i don't have to keep using the cart. Order Weight does not change. What I did:

- Set all three (product, configuration, shipping method) to pounds.
- Went to orders, edit order, increase quantity, save.

No change in Order Weight. Is this a bug?

So, I made another order - and yes, it does work. You are correct - I had miss settings in (product, configuration, shipping method). Thank you.

And, Milbo, while I have your attention, can you please let me know what variable I can use to display total order weight in the invoices? 
Title: Re: Problem with cart weight calculations
Post by: servlet on November 21, 2013, 20:14:51 PM
saviB
you say if I use pound instead of kilos everything is ok?