News:

Looking for documentation? Take a look on our wiki

Main Menu

Default child product

Started by Matt_Ginn, November 05, 2013, 12:11:21 PM

Previous topic - Next topic

Matt_Ginn

I have a parent product (that can't be bought) with 8 child products. When you go to the product details page for the parent, the children appear in a drop-down and the label 'Choose a product variant first' is shown. When one of the children is selected, the details for that child are shown and the label changes to the 'Add to cart' button. This is all correct, however, the client that I am developing this site for wants something a little different! He'd like it so that when you go to the product details page for the parent, one of the children on the drop-down list is automatically selected. So it's details would be shown, as would the 'Add to cart' button, and you'd never see the 'Choose a product variant first' label. There seems to be no way of making one child product the 'default'. Does anyone know a way (or can suggest a hack) to do this??

stresskills

I have the same issue. No solution so far. Any one have advice or a place to start?
"If you think you can do a thing or think you can't do a thing, you're right." Henry Ford

Matt_Ginn

I kind of got round this by making what had been the first child product into the parent and setting it to be displayed as an option and orderable.

stresskills

Quote from: Matt_Ginn on January 31, 2014, 17:12:59 PM
I kind of got round this by making what had been the first child product into the parent and setting it to be displayed as an option and orderable.
Thank you for reply
"If you think you can do a thing or think you can't do a thing, you're right." Henry Ford

gergnnud

I know this is a really old thread but the OP asks specifically for what I need. Unfortunately his workaround will not be entirely appropriate for us. I have tried this already. I finally got this new custom fields concept to behave OK for our needs. I must say the old 'custom attributes' in VM1  was much much better.

I too want to avoid the 'Choose a product variant first' and have it default to one of the child products however I need to get even trickier. Each year a new product model will be introduced that will become the default product so I'm guessing a major hack, an additional global field in the shop for the new product prefix so that when the new model is introduced the client can then change the value in this extra field and change the default child, the previous default child would then relegated to a non-default as it is phased out of production.

The VM experts out there will understand how much work there would be to change the parent and child set up for 10 products each with 3 or 4 child products each with about 150 of their own custom fields! Obviously I need to avoid that.

Any ideas would be much appreciated.

jenkinhill

Customs have been rewritten completely for VM3 so have a look at the latest RC, 2.9.9b  (2.9.9c will be available in a few days).
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Sheepiss

JOOMLA 3.4.8
Virtuemart 3.0.12

Hello,

have you found any solution to this topic?

I do not want to create one variant of product as a parent and set parent to show in the list of variants. Is there any other possibility of how to set one of the child product as selected by default, when entering a product default view?

Thanks,

Sheepiss

balai

You can do that by having your parent product orderable. Which renders it one of the variants

Jörgen

Hello Balai

Which child will then be default ?

Does this apply also to reviews ?

regards

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

balai

The parent product will be default and will have the role of a variant (the same as the child products)

Sheepiss

Setting parent product as one of the options is a part solution. When you do it this way, you will have on the category page view displayed all the parent variants of the products...for example if I would set "Blue T-shirt size S" as parent, on the view of T-shirts category you would see this variant. But I want to see on the category page view just "Blue T-shirt" and the variants of the product only on the product detail page.

Milbo

http://forum.virtuemart.net/index.php?topic=132929.msg460788#msg460788


Quote from: Milbo on February 04, 2016, 23:18:35 PM
It is even more complex. The categories are not inherited for browsing your products. Only products with a visible category are browseable within the store. The reason is that the sql searches for products which has an xref table entry to a certain category.

But a displayed product (also in the category browse page) is always inheriting the categories of the parent as long there is no category set.

So when you set 1 category, you override any category of the parent. Else we would have to merge the category arrays and it would not be possible to remove a category from a child. So either you set nothing, or you set any.

And to underline, there is the convention:
Categories are entered =>browseable in store

This "defines" also the diffference if you present a product as a variant or on its own

http://docs.virtuemart.net/manual/general-concepts/186-derived-products-product-pattern-child-products.html
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Sheepiss

Hello Milbo,

thank you for your reply. Do I catch it right, that there is no solution? You just have to decide if you present your products as a variants (set a category also for child products and then you will have for example in your category shown "blue t-shirt size S, blue t-shirt size M, blue t-shirt size L") or as a parent product with children (set a category only for the parent product, which should be in my example "blue t-shirt"), but in this second way you will have the problem, that if you enter the parent product page, you will not have any of child product selected and you have there only a button "choose a variant".

Thank you for any reply,

Sheepiss

Milbo

Quote from: Sheepiss on February 07, 2016, 21:49:23 PM
you will not have any of child product selected and you have there only a button "choose a variant".

As Balai said, if you make the parent "orderable", you can order it (add it to the cart).

You can use the parent as minicategory
=> not orderable
You can use the parent as own variant, which is then the default variant
=>orderable

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/