Author Topic: VM2 allows checkout of out of stock products  (Read 10443 times)

vaistik

  • Beginner
  • *
  • Posts: 14
Re: VM2 allows checkout of out of stock products
« Reply #30 on: June 05, 2014, 12:31:23 pm »
correct in the VM version you mention  - this is why I went with my system - to attach a flag as soon as it enters a cart.

Haven't checked the VM2.6.x series...

If you want to check it at Confirm purchase your going to have to write your own check in the cart system.

Thanks for the reply! It's a shame the client insists on doing the check during purchase confirmation, your plugin would save me ALOT of time. Do you have any pointers as to which files/functions I should look at?

I was thinking messing around with the dataValidated variable but couldn't find a proper way to do so.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9228
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: VM2 allows checkout of out of stock products
« Reply #31 on: June 05, 2014, 17:39:46 pm »
I haven't investigated this - I just attach a custom field to the product when 1st added to cart - any subsequent add to carts trigger a check if the product has that custom field - if so block it

You need to trace what triggers are called on confirm cart and write something for that that checks if it's really in stock..

from a user point of view  - you risk annoying the client with his nice selection of products - filled out his address, chosen payment - and then finds he can't confirm the cart.. :-[

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM2 allows checkout of out of stock products
« Reply #32 on: June 05, 2014, 19:21:24 pm »
http://www.rupostel.com/phpBB3/viewtopic.php?f=5&t=937&sid=1b5d2e395866210264df3bf3f077ebbc

The strange thing is that exactly this line should update the product with the new stocking. For me it looks like the check is just disabled.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM2 allows checkout of out of stock products
« Reply #33 on: June 06, 2014, 10:39:38 am »
Ignore the above - fix was found today that I can confirm works:
http://www.rupostel.com/phpBB3/viewtopic.php?f=5&t=937&sid=1b5d2e395866210264df3bf3f077ebbc

Again, I just rechecked it. This "fix" is definitly wrong, you just disable the function. Please try the attached file in BE/models

[attachment cleanup by admin]
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bunglehaze

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 allows checkout of out of stock products
« Reply #34 on: June 06, 2014, 19:45:50 pm »
Ignore the above - fix was found today that I can confirm works:
http://www.rupostel.com/phpBB3/viewtopic.php?f=5&t=937&sid=1b5d2e395866210264df3bf3f077ebbc

Again, I just rechecked it. This "fix" is definitly wrong, you just disable the function. Please try the attached file in BE/models

OK, I removed the commenting on Rupostel 'fix' and replaced the /administrator/components/com_virtuemart/models/product.php with the file you attached Milbo,  the add to cart function  is no different to how it was before the 'fix' (ie you cannot check out anything). I re-commented the line again and I can add to cart again.

I hope that helps figure this out.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM2 allows checkout of out of stock products
« Reply #35 on: June 06, 2014, 20:35:23 pm »
It works for me. I tested it. So please give me your exact configuration of the stocking and the settings of the products.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bunglehaze

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 allows checkout of out of stock products
« Reply #36 on: June 07, 2014, 00:03:09 am »
How do you want me to do that Milbo?  What files do you want to see?

norris

  • Beginner
  • *
  • Posts: 6
Re: VM2 allows checkout of out of stock products
« Reply #37 on: October 27, 2014, 01:16:13 am »
i can confirm the same experience as bunglehaze, after updating VM to 2.6.12 I had the problem with child variants showing up, but not able to be added to the cart unless the parent had some stock set.

I tried  replaced the /administrator/components/com_virtuemart/models/product.php with the file Milbo attached, but it didn't work.  I restored the original product.php and tried commenting out the line in cart.php and that fixed it.

bunglehaze

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 allows checkout of out of stock products
« Reply #38 on: October 27, 2014, 22:38:28 pm »
I have updated each version of VM2 since that 'fix' was first found and each time the same situation occurs with parent products flagging up the "out of stock" error when selecting child products in stock. Each time I commented the line in the 'fix' and it works again.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM2 allows checkout of out of stock products
« Reply #39 on: October 28, 2014, 01:59:26 am »
How works vm3 for you?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bunglehaze

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 allows checkout of out of stock products
« Reply #40 on: October 28, 2014, 02:37:06 am »
How works vm3 for you?

I haven't tried it for the last couple of revisions as the stockable plugin migration wasn't in place and my entire site us pretty much using it.

I have been hanging on until that worked and I'll give it a try