this is a question about the logic of an e-commerce cart built in php:
i have an item in the cart saved with a session in php, this session is named by a composed string where the unique key is given by the product_id:
$this->session->data['quote_total_'.$product_id];
the problem is when i add the same product in the cart but with diefferent price - the price is generated automatically by the system at the change of misures, options, and quantity - indeed the first value of the cart session that is the value of the first product price is overwritten by the new one. which is the best method to avoid this overwrite for you?
i was thinking about a unique value to append at the name of the session but i don't understand which ones...