News:

Looking for documentation? Take a look on our wiki

Main Menu

Child Products and Stock

Started by jflash, November 04, 2016, 21:11:44 PM

Previous topic - Next topic

jflash

Hello!

My english is bad but i try :) I have enabled option ' Do not Display Product, if child products also out of stock'. In VM 3.0.16 all works like i need: i see product and only child products where 'in stock' number bigger then 0 (or 'in stock' != 'booked, orderd'). Today i updated VM to 3.0.18 and now i see all child products. When i choose some custom field, it shows me 'in stock - 0' and shows add-to-cart button. If i add something to cart, message appears to choose to go cart or shop again. I choose go to cart but product does not go into cart (because 'in stock' = 0). Why i see add-to-cart button?

Now i made some research and found in file /components/com_virtuemart/sublayouts/customfield.php on row 92 new code:
Version 3.0.16:
if($stockhandle == 'disableit_children'){
$q .= ' OR (`product_in_stock` - `product_ordered`) <= "0"';
}

This code in version 3.0.18:
if($stockhandle == 'disableit'){
$q .= ' AND (`product_in_stock` - `product_ordered`) > "0"';
}


Now i made this file overwrite to template folder (/templates/gk_storebox/html/com_virtuemart/sublayouts/customfield.php) and put code from 3.0.16 after 3.0.18 code and my problem solved. Now i see only products where 'in stock' are bigger then 0. Is there some problem with  'disableit_children' and  'disableit'?
Joomla 3.6.4

Milbo

Seems we did an error here. I am not really happy with both options.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/