VirtueMart Forum

VirtueMart 2 + 3 => Product creation => Topic started by: Matt_Ginn on November 05, 2013, 12:11:21 pm

Title: Default child product
Post by: Matt_Ginn on November 05, 2013, 12:11:21 pm
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??
Title: Re: Default child product
Post by: stresskills on January 31, 2014, 07:40:15 am
I have the same issue. No solution so far. Any one have advice or a place to start?
Title: Re: Default child product
Post by: 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.
Title: Re: Default child product
Post by: stresskills on March 04, 2014, 23:56:21 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
Title: Re: Default child product
Post by: gergnnud on September 18, 2014, 06:05:54 am
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.
Title: Re: Default child product
Post by: jenkinhill on September 18, 2014, 10:23:07 am
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).
Title: Re: Default child product
Post by: Sheepiss on January 13, 2016, 17:07:13 pm
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
Title: Re: Default child product
Post by: balai on January 13, 2016, 17:12:04 pm
You can do that by having your parent product orderable. Which renders it one of the variants
Title: Re: Default child product
Post by: Jörgen on January 13, 2016, 17:17:44 pm
Hello Balai

Which child will then be default ?

Does this apply also to reviews ?

regards

Jörgen @ Kreativ Fotografi
Title: Re: Default child product
Post by: balai on January 13, 2016, 17:24:57 pm
The parent product will be default and will have the role of a variant (the same as the child products)
Title: Re: Default child product
Post by: Sheepiss on January 30, 2016, 19:59:27 pm
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.
Title: Re: Default child product
Post by: Milbo on February 05, 2016, 00:51:05 am
http://forum.virtuemart.net/index.php?topic=132929.msg460788#msg460788


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
Title: Re: Default child product
Post by: Sheepiss on February 07, 2016, 21:49:23 pm
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
Title: Re: Default child product
Post by: Milbo on February 08, 2016, 19:21:52 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