Jump to content

How to sort cart products using new variable?


736Online2

Recommended Posts

I have a module that is creating a new column (id_hash) in the cart_product table. By default prestashop groups products based off of the values in the cart_product table. I have figured out how to include my value in the new column, but I can't figure out where I need to override/add code in order for my new value to be taken into consideration. 

 

My current understanding is that somewhere the code looks at cart_product and compares id_cart to look for products for this specific cart.. it then looks to id_product, id_product_attribute, and id_customization to see if it is the same product and if it should simply be incremented or if there's a difference and it should be a new row in the cart. My goal is to add id_hash as one of the things it looks at to see if they should be grouped together.

I have tried editing Cart.php, CartPresenter.php, CartController.php as test to accomplish this but have been unsuccessful thus far.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...