How to add product in cart

1
Hello, I am working on an online application system.In which I want to design Add to cart feature.But I am facing the problem that how to add product in cart.Even I want to know which association is necessary between Cart and Product entities. So please help me. Thank You
asked
1 answers
1

Use a helper entity in between like 'orderline' as described in many of the example projects and learning paths by Mendix.

Basically you have an Order that's associated to a customer (1 customer - * order) and 1 order - * orderlines. Then each orderline should have an association with the product entity as 1 product - * orderlines. On the orderlines you can maintain the amount of products ordered and the price the customer needs to pay. This allows you to change the price on productlevel.

But it's a bit difficult to create a domain model for you through this forum. I suggest you take a look at the Mendix Advanced learning path in the Mendix Academy as it's project contains an example of a webshop.

answered