Parent product stock problem on Virtuemart 2.6.6

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Parent product stock problem on Virtuemart 2.6.6

Postby admin » Wed Jun 04, 2014 11:56 am

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Parent product stock problem on Virtuemart 2.6.6

Postby frugoli7 » Fri Nov 21, 2014 4:38 pm

Thank you so much for this! :D :D :D
frugoli7
 
Posts: 1
Joined: Fri Nov 21, 2014 4:37 pm

Re: Parent product stock problem on Virtuemart 2.6.6

Postby admin » Tue Dec 02, 2014 2:23 pm

welcome
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Parent product stock problem on Virtuemart 2.6.6

Postby phpman@.....ru » Fri Mar 13, 2015 6:02 pm

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 ?
phpman@.....ru
 
Posts: 4
Joined: Thu Mar 14, 2013 4:10 pm

Re: Parent product stock problem on Virtuemart 2.6.6

Postby admin » Mon Mar 16, 2015 12:40 pm

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2