Author Topic: How can i hide child from same category subject to availability and stock?  (Read 325 times)

motobrat

  • Beginner
  • *
  • Posts: 5
  • A beginner
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 2316
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: How can i hide child from same category subject to availability and stock?
« Reply #1 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
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3978
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: How can i hide child from same category subject to availability and stock?
« Reply #2 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.

motobrat

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: How can i hide child from same category subject to availability and stock?
« Reply #3 on: September 09, 2019, 08:32:13 am »
???
With default settings that is what happens.
Have you tested this, what are your settings?

Jörgen @ Kreativ Fotografi

No. There is parent and child products are visible in category, even when the parent product stock is zero. Need to show only one product. It can be parent product, when its published or its stock must be bigger than 0 and then child products must be hidden. If parent product is not published or its stock is 0, then parent product must be hidden from the category and child product which is published and its stock bigger than 0 must be shown, but only one child.
The idea is to display one product from the parent and the child products attached to it. This is necessary in order, for example, to simplify the search for the desired product in the category and not to publish several identical products of different sizes.

In the virtuemart 3 configuration i can only hide child categories, but there is no option about child products.

Here is the link to category for example. https://motobrat.com.ua/odezhda-i-ekipirovka/shlemy.html

Sorry for my bad english)

motobrat

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: How can i hide child from same category subject to availability and stock?
« Reply #4 on: September 09, 2019, 08:38:50 am »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 2316
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: How can i hide child from same category subject to availability and stock?
« Reply #5 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
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

motobrat

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: How can i hide child from same category subject to availability and stock?
« Reply #6 on: September 09, 2019, 17:22:54 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3978
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: How can i hide child from same category subject to availability and stock?
« Reply #7 on: September 10, 2019, 00:30:01 am »
I 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

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: How can i hide child from same category subject to availability and stock?
« Reply #8 on: September 10, 2019, 13:11:49 pm »
I 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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: How can i hide child from same category subject to availability and stock?
« Reply #9 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3978
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: How can i hide child from same category subject to availability and stock?
« Reply #10 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.