Page 1 of 1

Parent product stock problem on Virtuemart 2.6.6

PostPosted: Wed Jun 04, 2014 11:56 am
by admin
Dear friends, if your shop is configured to use Parent products with no stock level and you only assigned the stock level to the child products, your add to cart functionality will not work and will give "out of stock" error message.

To solve this within Virtumeart 2.6.x you may need to edit:
\components\com_virtuemart\helpers\cart.php

comment this line (on my install it's line 732):
Code: Select all
$product = $product_model->getProduct($product->virtuemart_product_id);


so it looks like this:
Code: Select all
// $product = $product_model->getProduct($product->virtuemart_product_id);



within
Code: Select all
private function checkForQuantities($product, &$quantity=0,&$errorMsg ='') {



commenting the line solves the problem.

Best Regards,
Stan

Re: Parent product stock problem on Virtuemart 2.6.6

PostPosted: Fri Nov 21, 2014 4:38 pm
by frugoli7
Thank you so much for this! :D :D :D

Re: Parent product stock problem on Virtuemart 2.6.6

PostPosted: Tue Dec 02, 2014 2:23 pm
by admin
welcome

Re: Parent product stock problem on Virtuemart 2.6.6

PostPosted: Fri Mar 13, 2015 6:02 pm
by phpman@.....ru
Hi all ! I have VM 2.6.10 and this does not work for me (((

Parent has 0 in stock
Child has 10 in stock

If a add at one time all 10 to the cart - it works fine.
But if I add first 5 and then 20 for example - there are 25 in the cart (((

What i have to do ?

Re: Parent product stock problem on Virtuemart 2.6.6

PostPosted: Mon Mar 16, 2015 12:40 pm
by admin
hello, are you using our OPC? if not, i suggest to update your VM to latest 2.6.x branch or to submit this to the VM forums. This forum is purely for OPC related support.

OPC itself does not handle the add-to-cart functionality, but this is done in VM.

best regards, stan