Author Topic: Default child product  (Read 2582 times)

Matt_Ginn

  • Beginner
  • *
  • Posts: 42
Default child product
« 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??

stresskills

  • Beginner
  • *
  • Posts: 22
    • My work from HB
Re: Default child product
« Reply #1 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?
"If you think you can do a thing or think you can't do a thing, you're right." Henry Ford

Matt_Ginn

  • Beginner
  • *
  • Posts: 42
Re: Default child product
« Reply #2 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.

stresskills

  • Beginner
  • *
  • Posts: 22
    • My work from HB
Re: Default child product
« Reply #3 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
"If you think you can do a thing or think you can't do a thing, you're right." Henry Ford

gergnnud

  • Beginner
  • *
  • Posts: 7
Re: Default child product
« Reply #4 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.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27432
  • Always on vacation
    • Jenkin Hill Internet
Re: Default child product
« Reply #5 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).
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

Sheepiss

  • Beginner
  • *
  • Posts: 7
  • A beginner
Re: Default child product
« Reply #6 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

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1368
Re: Default child product
« Reply #7 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

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2180
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Default child product
« Reply #8 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
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1368
Re: Default child product
« Reply #9 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)

Sheepiss

  • Beginner
  • *
  • Posts: 7
  • A beginner
Re: Default child product
« Reply #10 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.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9843
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Default child product
« Reply #11 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
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Sheepiss

  • Beginner
  • *
  • Posts: 7
  • A beginner
Re: Default child product
« Reply #12 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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9843
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Default child product
« Reply #13 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

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