VM2.0.2 bug in cart adding same product with various customfields

Started by supermac, March 07, 2012, 09:50:17 AM

Previous topic - Next topic

supermac

I've a product with customfields (type 'cart variant', not child product).
I add to cart the product with some options (customfields) selected and continue shopping, then add the same product with other options.
The cart page shows correctly two rows: the rows have product in cart.
When I confirm order registrarion I see two records in virtuemart_order_items table but the mail sent to customer and the order detail page shows just one row (the first record) with its related prices/discounts and, in footer, the total amount of both rows (correct).

Bug encountered even with sample product adding cart variant customfields to a product.

I'm trying to see if trouble is in administrator/components/com_virtuemart/models/orders.php: the function getOrder contains a SELECT with group by product_id... if I comment the "group by" order page seems to work..... but generates this troubles in other places?

Really urgent, I need to solve this issue asap!

Milbo

Interesting, I need to find the post, someone said the stuff is then doubled and suggested to add the group by
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

supermac

Milbo I agree that everyone wants something different and is difficult to make everyone happy, but even if grouping has been suggested by HRM Queen Elizabeth, the bug is there: grouping by product item, the views shows one row with the price of just one item (the first occourred in table by the query) and doesn't shows the sum of prices of items with same product_id grouped.

In any case, if customfield options modify the price of item, as in my case (I suppose that this is one of the most common use of customfields), I would know the customer that wants to see just the total of items grouped in a single row instead of X rows, one for each item with its specifc price...


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

daduke

Hi,

I'm having the exact same problem. Why does the subject say 'Solved' - is it?
Are there any news on this topic? I'm afraid this issue renders my VirtueMart useless  :(

I'd be happy to help debug / test it, but I'm new to VirtueMart.

thanks,
-Christian

supermac

I solved my need commenting the "group by" statement in the php page I was talking about

daduke

can you remember where you found this? Would be really helpful.

thanks,
-Christian

supermac

I wrote
administrator/components/com_virtuemart/models/orders.php
into the function getOrder

Milbo

It should be fixed in the svn with 'group by `virtuemart_order_id` '
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

supermac

Milbo I'm seeing that even the product quantity management has something wrong: when I order two items (same product with different customfields) it doesn't decrease the stock qty/increase the order qty correctly but it does it using just the qty of the first record encountered in virtuemart_order_item...
The "update order status" routine seems to have the same issue....
May you confirm?


supermac

mmm big trouble... I'm investigating (my site should be live since last week)

supermac

Well, about the increasing/decreasing of stock quantity when user orders same product with various customfields options, I see that the function "updateSingleItem" in orders.php works correctly.
I tested it changing the single item status from pending to shipped and other item by item in BE: it always updates the stock quantity correctly.


supermac

Still in the trouble.
A customer bought two products (always same product width different customfields... two rows in table virtuemart_order_items) and paid with Paypal.
Paypal settings in VM2 updates order status automatically to 'S' when payment is confirmed.
Payment has been confirmed by Paypal.
In virtuemart_orders table now I see order_status = 'S'
In virtuemart_order_items table I see order_status = 'S' in first item's row and 'P' in second item's row !!!!

At this point, I didn't had a look to product stock and ordered quantities in BE product's page so I don't know if at this moment stock/ordered situation was right, but correcting item status to 'S' in BE order's page it results in a wrong ordered and stock quantities (as the item would have been counted two times, I think)

This is my idea (but I could be wrong), I report it here if it can be useful to fix the issue:
maybe there is an ambiguous duplication of processes, when is updated status of entire order and when is updated status of single item.
I think that when entire order status is changed (manually from BE order page or automatically by payment plugin), it should be invoked the "single item update" process to update item status and stock/ordered quantities... instead, having that single item staus process works correctly as I tested before, it seems that there's a separated process for entire order status that is applied to entire order and just first row of ordered items....

daduke

I can't say anything about Paypal, but at least adding products with variants to the cart and having them subtracted from the correct stock does now work since I've upgraded to 2.0.3.D