VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: marvays on December 16, 2019, 09:09:59 AM

Title: Hide parent product from class="product-field-display"
Post by: marvays on December 16, 2019, 09:09:59 AM
Hello. I'm solving a problem.
I have a parent and a child.
In the drop-down list I have "Choose a variant" in the first place.
When I expand the list, I see "select a variant" on the first line again and then the product variants.

Can I disable the "select variant" display in the drop-down list in VM settings? When I select a varinate, this field may no longer display. Make it perfect.

I solved it in css:
.product-field-display option:first-of-type {
    display: none;
}


But it should be automatic.
Title: Re: Hide parent product from class="product-field-display"
Post by: pinochico on December 16, 2019, 10:01:57 AM
Great :)

Why do You do it? I need first line - the first line tell customer - Please, select  child (or material, or width, or another - in attachment == Vyberte materiál, Vyberte rozměr)
Title: Re: Hide parent product from class="product-field-display"
Post by: marvays on December 16, 2019, 10:15:28 AM
(https://i.postimg.cc/YGkxD8WZ/Hide-parent-product-from-class-product-field-display.png) (https://postimg.cc/YGkxD8WZ)

This is unnecessary in the drop-down list and does not look good.
I'll say everything important then. In addition, the first position in the drop-down list is active and points to the parent. And I don't want to send the buyer to parents, but only to children.
Title: Re: Hide parent product from class="product-field-display"
Post by: pinochico on December 16, 2019, 13:22:14 PM
QuoteAnd I don't want to send the buyer to parents, but only to children.

Hmm, our client considers it a mistake and want to send buyer to parents - if customer create mistake, then can't go back from selected child to parent (only in button in browser) :)
Title: Re: Hide parent product from class="product-field-display"
Post by: marvays on December 16, 2019, 14:04:59 PM
Nenapadá mě jediný důvod, proč by měl být zákazník přesměrován na rodiče.