I am creating a shopping cart where I am trying to add different types of product e.g. Mobiles
, clothes
etc.
I have created a add_to_cart
method and added products to session, then at last I save all products to database table.
But now I am confused how to add different product because parameter for different products are different e.g.
1. product_id, quantity, price for mobile.
2. product_id, quantity, price, size for cloths.
....
should I create different add_to_cart()
method for different types of products.