Author Topic: VM 3.0.18 - Users can order deactivated products  (Read 1820 times)

jzmm

  • Beginner
  • *
  • Posts: 2
  • A beginner
VM 3.0.18 - Users can order deactivated products
« 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?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3136
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: VM 3.0.18 - Orders of deactivated products
« Reply #1 on: October 20, 2016, 13:32:47 pm »
When have these Products been unpublished ?

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10074
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 3.0.18 - Users can order deactivated products
« Reply #2 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
Code: [Select]
$productTemp = $productsModel->getProduct($productdata['virtuemart_product_id'],TRUE,true,false,$productdata['quantity']);

and replace it against
Code: [Select]
$productTemp = $productsModel->getProduct($productdata['virtuemart_product_id'],TRUE,TRUE,TRUE,$productdata['quantity']);
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jzmm

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: VM 3.0.18 - Users can order deactivated products
« Reply #3 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.

StefanSTS

  • Global Moderator
  • Full Member
  • *
  • Posts: 549
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: VM 3.0.18 - Users can order deactivated products
« Reply #4 on: October 21, 2016, 10:09:28 am »
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
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10074
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 3.0.18 - Users can order deactivated products
« Reply #5 on: October 25, 2016, 12:21:49 pm »
The changed parameter even removes products from the cart.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4382
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: VM 3.0.18 - Users can order deactivated products
« Reply #6 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.