I’m building a catalog app that displays product prices and it works great, but I’m looking to add products that have variations in size and colors (let’s say the variation is dynamic) with different prices.
I really would like the user to be able to select the product and a section that says “Click here to see the variations” appears below.
I’ve searched this group and Google but couldn’t find a solution so I’m wondering if this can be done.
I saw an application created here but I don’t quite understand how that step was done
The app is serious, sorry if I want to copy that function but it seems perfect to me
I don’t know how to make the app work correctly because of the products and their variants
I feel like I’m having a creative block that doesn’t let me think things through to solve this problem
to date I would like to know should I have 2 tables:
Products
Variants
How do I relate so that the products table is the main one where the admin adds the products and in the same way when adding it can add the variants to the other table
After that, the user will be shown “THE ORIGINAL PRODUCT”, with the option to see the variants below
So you need Variant table have row with original product id
You need multi relation from original id to variant table product id
And you can show inline list sourced from this relation
I already have my table where the products go and I have my table of the variants
the two are related by Product_ID
from there I need the admin to be able to add products with their variants
would it be two forms? one for the original product and one for the variant?
because doing it that way adds the variant but the variant itself is not added as a new product and it is not shown in the catalog so that the user can select it
I see that you know a lot about the subject, let’s say that I want to perform the functionality that is the same as that app that I must do in addition to relational tables
May be another person can gave you better solution, because im confused why he need second table this way? Why you cant use just like category for item. All item in a category is a variants of it. So you just need column named category id and items which same - have same category id an all of it is variants you can group it and relate in same table. Or im wrong?
Wait inems with type ID and selected color id need to find variants with different sizes?
If like this, you need some sort of if then validation and then relate to it, like a dynamically filter.
i’m not promises, but i will try prepare prototype next morning if nobody explain to you
Okay I see that you are confused by the lack of information if you want I will detail it for you to see
It is an application about a catalog of products that are sold in a factory for a school project
each product belongs to a category or subcategory
Certain products have variants of themselves (eg: color, size)
Based on these variations, the price changes
Each variation of each product can have an offer price, which is determined by the administrator
The administrator is in charge of adding, editing and deleting products
The application must be dynamic, so products, variations, prices, categories and subcategories must be added from the same app
Each product must be shown to the user with its corresponding information (Price, variation, internal product code, etc.)
The user must choose the product to know its price and descriptions of the same (that is where the variations come in, which have the option of selecting one and showing their respective information)
I have already done all the steps mentioned except for the product variations