Shopping Cart Vanilla JS

My motivation is to practice OOP particularly the ES6 Class.

Learnings

While creating the classes, I came across a problem where I was considering creating a class for a different product type. Instead of just having one 'Furniture' class, I was thinking of dividing it into 'Bedroom,' 'Living Room,' and 'Home Office' classes, each with its own unique properties and methods, but still inheriting some methods. However, JavaScript doesn't allow multiple inheritance, so using multiple 'extends' of parent classes is not possible. I saw different solutions suggested online, but it seems like they would be more complicated and could cause issues with inheritance order. I realized that this problem could be easily solved by using composition. Now, I understand why classes have been replaced by functional programming, which frameworks like React use.

Design Credit

I got the inspiration from Behance.net. I tried to recreate it.

Design

open-cart