danielwoods21's avatar

how to define my ecommerce product filtering system in laravel

hi i need some help for creating products filtering system in ecommerce website. i have a lot of laptops and well those laptops have diffrent os,color,ram size,cpu type,display resoulution and so on. what is the best approach about specifications? do i store them in tables of database and relate them to products or i store them as array or some thing similar in application code? please help

0 likes
4 replies
Screenbeetle's avatar
Level 15

Morning danielwoods21

You'll need to separate out your base products (laptops) and related attributes (os, ram etc) into separate tables with one to many relations. Before you start though it's useful to work out a few things:

How are your SKU's created? Do different specifications have a unique sku?

How will your store stock levels? Do different specifications need to have their own stock stock levels?

Do you need to be able to filter / search by all attributes? If so then normally you'll need a record of each 'attribute type' (e.g size) as well as a record of all possible values (12", 14", 15" etc).

1 like
danielwoods21's avatar

i dont have any exprience with ecommerce but i have some ideas.im just a little confused since this is very big i have a lot o categories laptops,mobiles,desktops,and all o them have their own specifications. but well desktop and laptop have same parent id and this helps to saparate spesc.

danielwoods21's avatar

do you have any idea abouting using interface or abstract class for Specification model?

Please or to participate in this conversation.