VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: motobrat on September 08, 2019, 13:19:14 PM

Title: How can i hide child from same category subject to availability and stock?
Post by: motobrat on September 08, 2019, 13:19:14 PM
Hello!
How can i hide child product in Vituemart 3 from category if parent is published in same category?
For example, in category c there is a parent product and its child products. If the parent product is not in stock or it is not published, thrn need to display one child product, only one of which has a stock greater than zero and which is published.
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: Jörgen on September 08, 2019, 15:30:39 PM
???
With default settings that is what happens.
Have you tested this, what are your settings?

Jörgen @ Kreativ Fotografi
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: Studio 42 on September 08, 2019, 21:49:59 PM
You need to set the category,if you want display the child product in the same category as parent, if the parent product is not published.
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: motobrat on September 09, 2019, 08:38:50 AM
Quote from: Studio 42 on September 08, 2019, 21:49:59 PM
You need to set the category,if you want display the child product in the same category as parent, if the parent product is not published.

Yes, but in this case, all products are displayed, both the parent and all child products. But i need to display only one of them, and the rest should be hidden.
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: Jörgen on September 09, 2019, 09:23:52 AM
Make parent not orderable and take away category from children. Then you will only see the parent.
Jörgen @ Kreativ Fotografi
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: motobrat on September 09, 2019, 17:22:54 PM
Quote from: Jörgen on September 09, 2019, 09:23:52 AM
Make parent not orderable and take away category from children. Then you will only see the parent.
Jörgen @ Kreativ Fotografi
I did this before. But if parent product will be unpublished the child will not be shown in category. I need to show parent product or one of the child products in this category.
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: Studio 42 on September 10, 2019, 00:30:01 AM
Quote from: motobrat on September 09, 2019, 17:22:54 PMI need to show parent product or one of the child products in this category.
If you unpublish parent and dont want set a category in the children, then you dont see the children in category.
Is this so hard to understand ?
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: motobrat on September 10, 2019, 13:11:49 PM
Quote from: Studio 42 on September 10, 2019, 00:30:01 AM
Quote from: motobrat on September 09, 2019, 17:22:54 PMI need to show parent product or one of the child products in this category.
If you unpublish parent and dont want set a category in the children, then you dont see the children in category.
Is this so hard to understand ?
Please try to understand what im asking....
I have more than 3000 pruducts in the virtuemart shop. The prices, stock quantaty and product publication is updating automaticly. According to your logic, you need to manually remove from the category or add products to the category almost every day after automatically updating prices and balances. This is unreal...

Once again I will try to formulate the problem. There is a parent product and its child products. In fact, this is one product that differs in individual parameters (size, color, SKU, etc.). One of these products must be displayed in the category. if it is available and published. The rest of the remaining parent and child products that are in stock and published should not be displayed in the category. This is necessary so that the same product does not appear in the category, for example: a yellow helmet S, a yellow helmet M, etc. And also, to display the product with the current price and availability.

Title: Re: How can i hide child from same category subject to availability and stock?
Post by: GJC Web Design on September 10, 2019, 13:35:50 PM
maybe I misunderstand what u want  but normally u just display the parent with a dropdown of children as we do here.

https://www.escape-watersports.co.uk/clothing/jackets

we also have stock scripts running every 5 mins or so and this also un-publishes or publishes children that go out of or in stock
The children have no category

if all children have no stock then we replace the dropdown with an out of stock label in the template
Title: Re: How can i hide child from same category subject to availability and stock?
Post by: Studio 42 on September 11, 2019, 23:27:42 PM
Parent not orderable should work, of course if you unpublish the parent you never see childrens.
If you have Vm3.4+ then it should display only published children with stock.