adamsilva01 Posted December 12, 2016 Share Posted December 12, 2016 Hey guys, I want to add the same product in the cart multiple times, but as if they were different products. Do you know how I could do that programmatically? Basically I want the cart to look something like this: Product 1 Product 2 Product 3 Product 1 Product 2 Product 2 Link to comment Share on other sites More sharing options...
mister_j Posted December 13, 2016 Share Posted December 13, 2016 You need to make Cart controller override and make some customizations then adding product, that they will be not the same. I think it's the easiest way Link to comment Share on other sites More sharing options...
adamsilva01 Posted December 13, 2016 Author Share Posted December 13, 2016 (edited) The only way I managed to do that was to remove the attribute primary key in all the fields in the table cart_product so as to allow repeated rows with the same values. However, I don't know if that will affect the rest of the shop in any way. And also, when I did that, the shopping cart does not dynamically refresh. Do you know how I can force the refresh? A main problem that appeared to me right now is the delete process. I've managed to add same products separately, but the deleteProduct function deletes based on the id_product and the id_cart. The rows in the database for equal products appear separately, but then it deletes everything that has the same id_product and same id_cart. Any idea on how to bypass this and only delete the product I selected? The only way I could think of was to add another column to the cart_product table like product_position. But then I have to add that column in a lot of places in the code, but I'm not sure exactly where.. Edited December 13, 2016 by adamsilva01 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now