Author Topic: Child Products and Stock  (Read 1196 times)


  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 43
Child Products and Stock
« on: November 04, 2016, 21:11:44 pm »

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:
Code: [Select]
if($stockhandle == 'disableit_children'){
$q .= ' OR (`product_in_stock` - `product_ordered`) <= "0"';
This code in version 3.0.18:
Code: [Select]
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


  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Child Products and Stock
« Reply #1 on: November 07, 2016, 15:32:42 pm »
Seems we did an error here. I am not really happy with both options.
I should fix your bug, please support the VirtueMart project and become a member
Extensions approved by the core team: