VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: jzmm on October 20, 2016, 09:17:47 AM

Title: VM 3.0.18 - Users can order deactivated products
Post by: jzmm on October 20, 2016, 09:17:47 AM
Joomla   3.6.2
VM         3.0.18
php        5.6.5

After the VirtueMart Update some Customers ordered disabled Products.

When I click on the product link in the order e-mail,  I get a 404. Also it's not possible to find them "manually" by searching the name, ID...

The only idea I have is that the customers see a cached version of the site, where those products are still activated. But even this I can not really imagine.

How is this possible? What can I do to solve it?
Title: Re: VM 3.0.18 - Orders of deactivated products
Post by: Jörgen on October 20, 2016, 13:32:47 PM
When have these Products been unpublished ?

regards

Jörgen @ Kreativ Fotografi
Title: Re: VM 3.0.18 - Users can order deactivated products
Post by: Milbo on October 20, 2016, 13:33:39 PM
This is really strange. You can try it yourself..... put a product in the cart and unpublish it, reload and it should be gone.

lol damn, does not work. you are right. There is a small typo. Open the cart helper /components/com_virtuemart/helpers/cart.php

Search in the function prepareCartData around line 1574 for

$productTemp = $productsModel->getProduct($productdata['virtuemart_product_id'],TRUE,true,false,$productdata['quantity']);


and replace it against

$productTemp = $productsModel->getProduct($productdata['virtuemart_product_id'],TRUE,TRUE,TRUE,$productdata['quantity']);
Title: Re: VM 3.0.18 - Users can order deactivated products
Post by: jzmm on October 20, 2016, 14:10:45 PM
Thank you very much!

Hopefully this fixes the bug ;)

But can you explain why some customers saw those products and others don't?
Those products where already deactivated before the update.


Best regards.
Title: Re: VM 3.0.18 - Users can order deactivated products
Post by: StefanSTS on October 21, 2016, 10:09:28 AM
Quote from: jzmm on October 20, 2016, 14:10:45 PM
But can you explain why some customers saw those products and others don't?
Those products where already deactivated before the update.

Is it possible that in those cases the customer had the product already in the cart from an earlier visit?
In these cases it is best to ask the customer what exactly happened.

Stefan
Title: Re: VM 3.0.18 - Users can order deactivated products
Post by: Milbo on October 25, 2016, 12:21:49 PM
The changed parameter even removes products from the cart.
Title: Re: VM 3.0.18 - Users can order deactivated products
Post by: Studio 42 on October 25, 2016, 16:12:37 PM
Yes, the explain is basic. Old cart, is in session, so if you connect you the product is(was displayed) and because getProduct do not checked for published, it was valid.