Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

How can we support variants in payload?

default discord avatar
mailaneellast year
1
https://help.shopify.com/en/manual/products/variants

Use cases:


- Variants in ecommerce can have different images, skus, weights etc.,


- Variants in financial product comparison can have different terms and conditions, interest rates, descriptions



How I would like to use this feature?


- I would like fields to fallback if a particular field is not present in variant (similar to localisation)


- Treat variant product as its own item

  • default discord avatar
    notchrlast year
    @128658295727587330

    I think Blocks would be an acceptable solution for Variants



    You can conditionally render blocks based on condition of a sibling field, so this would allow you to display different data patterns



    You could then define the blocks in their own files to be tidy



    https://payloadcms.com/docs/fields/blocks#blocks-field
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.