Open kev1ncal opened 4 years ago
Take a look at
https://github.com/Crinsane/LaravelShoppingcart/blob/f460ab7312cce32cb428cf39a500a2d16600b1d6/src/CartItem.php#L330
RowID is based on the ID and Options so you can add the same Product but with different options resulting in different Positions/Items on the Cart. For example if you add a Product
instance it has multiple variances like color or size etc which should be treated as seperate positions in the calculation but not necessarily as seperate models in your data structure, therefore the identifier for the CartItem has to be a combination of the ID and the options (hash).
Is this some kind of magical way of getting an item in the cart? Why do you have to make the rowId as the most important thing to search for items inside the cart? e.g get() function requires rowId instead of the given ID?