Skip to content

Commit 8488bb2

Browse files
authored
Update README.md
1 parent 966e8e5 commit 8488bb2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ There are several ways you can add items on your cart, see below:
112112
# ALWAYS REMEMBER TO BIND THE CART TO A USER BEFORE CALLING ANY CART FUNCTION
113113
# SO CART WILL KNOW WHO'S CART DATA YOU WANT TO MANIPULATE. SEE IMPORTANT NOTICE ABOVE.
114114
# EXAMPLE: \Cart::session($userId); then followed by cart normal usage.
115+
116+
# NOTE:
117+
# the 'id' field in adding a new item on cart is not intended for the Model ID (example Product ID)
118+
# instead make sure to put a unique ID for every unique product or product that has it's own unique prirce,
119+
# because it is used for updating cart and how each item on cart are segregated during calculation and quantities.
120+
# You can put the model_id instead as an attribute for full flexibility.
121+
# Example is that if you want to add same products on the cart but with totally different attribute and price.
122+
# If you use the Product's ID as the 'id' field in cart, it will result to increase in quanity instead
123+
# of adding it as a unique product with unique attribute and price.
115124

116125
// Simplest form to add item on your cart
117126
Cart::add(455, 'Sample Item', 100.99, 2, array());

0 commit comments

Comments
 (0)