You have to use product_category or in table you can try category_id which is easy to make realationship via model.
Nov 17, 2022
3
Level 1
i am confused if i should use product_category pivot table or use tags table and product_tags table
i have an ecommerce application where i have categories and subcategories now the problem is for eg:- i have a category calls Clothes which have subcategories Men, Women and Kids and each subcategory has its own subcategories like men hoodies, men jeans etc... but i want to show men hoodies in black hoodies category too etc...
so i have 2 options either make 1) product_category table or make 1) tags table and 2) product_tags table so what should i do ??...
Clothes - Main Category--
|_Men
|_Men Hoodies // this is the men hoodies
|_Men Jeans
|_Men Jackets
|_Women
|_Women Skirts
|_Women Hoodies
|_Women Bags
|_Kids
|_Kids Toys
|_Kids Pants
All Hoodies - Main Category--
|_ Black Hoodies //but i want to show the men hoodies here too
|_ Detachable Hoodies
|_ Funky Hoodies
Please or to participate in this conversation.