News:

Support the VirtueMart project and become a member

Main Menu

How can i hide child from same category subject to availability and stock?

Started by motobrat, September 08, 2019, 13:19:14 PM

Previous topic - Next topic

motobrat

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.

Jörgen

???
With default settings that is what happens.
Have you tested this, what are your settings?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

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.

motobrat

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.

Jörgen

Make parent not orderable and take away category from children. Then you will only see the parent.
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

motobrat

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.

Studio 42

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 ?

motobrat

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.


GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

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.