VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: positronio on September 01, 2020, 10:19:07 AM

Title: child products stock
Post by: positronio on September 01, 2020, 10:19:07 AM
Hello, can you please add an option in"Action when a Product is Out of Stock" in virtuemart configuration that when all child products stock is 0 (stock - booked ordered =0)
then the parent product also stock 0??
I think the option "Do not Display Product, if child products also out of stock" is useless because if someone uses this and all products become out of stock then the product site will be blank.
Thank you.
Title: Re: child products stock
Post by: pinochico on September 01, 2020, 10:35:25 AM
QuoteI think the option "Do not Display Product, if child products also out of stock" is useless because if someone uses this and all products become out of stock then the product site will be blank.

You think wrong.
My clients need visible parents products, if all child products is out of stock.

Thank You.
Title: Re: child products stock
Post by: positronio on September 03, 2020, 19:58:10 PM
this is what exactly i'm saying! I want when all childs are out of stock, the parent to be present and not disappered. Then automatically the parent product should say with a badge 'out of stock'.
Title: Re: child products stock
Post by: Jörgen on September 03, 2020, 20:10:50 PM
Have You tested this ?

Jörgen
Title: Re: child products stock
Post by: pinochico on September 03, 2020, 23:20:54 PM
Quotethis is what exactly i'm saying! I want when all childs are out of stock, the parent to be present and not disappered

Is normal function for me

QuoteThen automatically the parent product should say with a badge 'out of stock'.

Is not core function, but we use plugin Labels and product in stock has label In Stock.
Title: Re: child products stock
Post by: positronio on September 05, 2020, 10:34:22 AM
i'm sorry pinochico but i don't understand your comment at all.
This "Do not Display Product, if child products also out of stock" is virtuemart action. Do you understand what its usage is for?
Title: Re: child products stock
Post by: positronio on September 05, 2020, 21:30:02 PM
does anyone please can tell me the file in virtuemart that handles this option.
"Do not Display Product, if child products also out of stock". I use virtuemart 3.8.4 version.
Thank you in advance!!!
Title: Re: child products stock
Post by: pinochico on September 05, 2020, 21:41:15 PM
No,

but I can learn how do you find them (I think this must be first knowledge, even if you are not a PHP developer or programmer - I'm not developer).

1. Go in administration VM, where is this checkbox
2. Find in html code by Inspect Element this element
3. Go in FTP, run terminal and find this element by linux command - grep
4. Check all occurrences in FTP in all files
Title: Re: child products stock
Post by: pinochico on September 05, 2020, 21:49:54 PM
preview
Title: Re: child products stock
Post by: pinochico on September 05, 2020, 21:55:42 PM
So I don't know/understund  what do you want, but all occurrences are there:

components/com_virtuemart/sublayouts/customfield.php
components/com_virtuemart/sublayouts/snippets.php
administrator/components/com_virtuemart/models/product.php
administrator/components/com_virtuemart/views/config/tmpl/default_shopfront.php
administrator/components/com_virtuemart/views/product/tmpl/product_edit_status.php
administrator/templates/vmadmin/vmadmin/html/com_virtuemart/config/default_shopfront.php
administrator/templates/vmadmin/vmadmin/html/com_virtuemart/product/product_edit_status.php

Now you can change all codes about your checkbox :)