Option to choose view mode for injected product variation in views

Created on 20 September 2017, over 7 years ago
Updated 19 January 2024, about 1 year ago

I have a problem to create site which satisfies the two basic requirements:
1. Having a product page preview (on url product/1) which should contain injected product variation fields and add cart form button
2. Custom product view (list of products) which should not contain injected product variation fields and should contain only add cart form button (and teaser image of product)

Seems like trivial thing, but it's actually impossible to achieve this without additional hacking/tweaking. Because:
- if you want to satisfy point 1 you need to Inject product variation fields AND render product default display mode with Variations field as "Add to cart form".
- if you want to satisfy point 2, then you need to disable option about injecting fields, because if view is using rendered product (and if that option is on) it will inject the fields

And that's a conflict. I can satisfy point 1 or point 2, but not both. If only I could tell the view to use custom display view mode for those injected fields, then I could hide them all, but it's not the case, it's always using Default display for Product variation

✨ Feature request
Status

Active

Version

3.0

Component

Product

Created by

πŸ‡ΈπŸ‡°Slovakia hideaway

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    +1 on #14 that's the only correct implementation!

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @Maintainers: Do you also agree with #14? Then we could proceed here for 3.0.x!

    Another alternative would be to have all fields as pseudo-fields on the product variation, if the option is selected. That would be even more flexible and would put these even at the display configuration level for all display modes!

    I think one of both ways should be chosen!

  • πŸ‡¬πŸ‡§United Kingdom newaytech

    For anyone else landing here - I worked around this by:

    • disabling the tick box to inject the variants
    • For the default product view - tick layout options > Use Layout Builder
    • Within layout builder - then add "Variations" field - using "Add to cart form" formatter
    • Within layout builder - then add "Default variation" field - using Rendered entity formatter and bespoke View mode if needed
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @newaytech - that shows there's still demand for this. I'd love to get some maintainer feedback i #14 to proceed here.

  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

    For the record I would love to see this too.

Production build 0.71.5 2024