I'm using VM 2.6.10
When I add to cart some quantity for a child product VM check for parent stock quantity not for the child
Real example:
I am in (parent) product detail page (parent id product is 1038)
I choose one child product and add some quantity for the cart (chosen child product id is 1980)
In firebug these parameters are sent:
url: .../index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json&lang=it&_=1410127200612
post parameters:
Itemid=773
_=1410127545355
customPlugin[3345][stockable][child_id]=1980
customPlugin[3345][stockable][selectoptions1]=M
customPrice[1][44]=3345
format=json
lang=it
nosef=1
option=com_virtuemart
quantity=1
quantity[]=2
task=addJS
view=cart
virtuemart_product_id[]=1038
you can see that "virtuemart_product_id" param is the parent id product
in file /components/com_virtuemart/helper/cart.php on line 731 is declared "checkForQuantities($product, &$quantity=0,&$errorMsg ='')" function
$product param dump is:
stdClass Object
(
...
[virtuemart_product_id] => 1038 (

?? parent product id not child!)
[product_parent_id] => 1038 (OK)
[product_sku] => 10213EM (CHILD SKU, OK)
[product_name] => TAGLIA M (CHILD NAME, OK)
[product_in_stock] => 10 (CHILD STOCK, OK)
...
)
the strange here is that "[virtuemart_product_id]" property is the parent product id instead of the child
then on line 746-748 in the same file there is:
// update the stock info from the database
$product_model = VmModel::getModel('product');
$product = $product_model->getProduct($product->virtuemart_product_id);
so before I had the right child stock, now VM get the wrong parent stock because $product->virtuemart_product_id is the parent id
I Have been clear enough?