Product Variants / Combinations
![Joseph](https://us.v-cdn.net/6037124/user_avatars/3832125.jpg)
Hi all,
I would like to create a combination of products for the different options that may be available. So for example, a T-shirt may have:
- sizes [S, M, L]
- colours [red, green, blue]
That gives 9 (3x3) combinations. How would one go about working the function stack?
Any/all help is greatly appreciated! :)
Answers
-
-
Hi @nocodetalks, yes somewhat. Its more like the size/colour will affect the pricing. Like a bigger size would be more expensive.
-
Treat "color" and "sizes" as the add-on.
The product will have the base price, and if the user changes the colour and size then the "add-on" price will be added to the base price.
Create two tables, "Color" and "size". Now add the different colors and sizes available to the product into this table.
Product table should have a reference to these "color" and "size" with a list of item.
-
Thanks for that, will give that a go
-
@Joseph this is the domain of SKU (stock-keeping unit) management. Most e-commerce systems would treat each combination as an inventory item to be sold. So if you have nine possible t-shirts each with different prices, you might reflect them as nine possible products in your system. That makes the logic much easier - you're just pulling nine records from your product table to reflect the SKUs.
But I'd start with a small grounding on what SKUs are in e-commerce so you can make an informed decision of how to integrate the idea into your system. Here's a primer: https://www.bigcommerce.com/ecommerce-answers/what-is-a-sku-how-online-business-use-it/
We discuss these kinds of higher-level questions during our daily office hours on State Change Pro.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback