Comments (4)
Hmm looks like "Condition on Per-Item Bases" is just for that.. it is right there in the Readme. You can apply it on add, or later:
Add condition to existing Item on the cart: Cart::addItemCondition($productId, $itemCondition)
Works fine for me. Maybe check if you've given the right $productId
Cheers
from laravelshoppingcart.
Not sure if you've read my question entirely. It's about the quantity of the condition, not how to add condition to a cart item
from laravelshoppingcart.
If you want to achieve this, you should somehow save the second and the third product with different ID, so they won't get under the condition like the first one.
But I don't think this could happen for the products under the same ID in the cart.
I would make it with some checks on adding, if the product exists in the cart, to save it with some prefix (or suffix) on the ID. And to apply this condition only on the products that have no suffix. Something like that.
Cheers
from laravelshoppingcart.
If you want to achieve this, you should somehow save the second and the third product with different ID, so they won't get under the condition like the first one. But I don't think this could happen for the products under the same ID in the cart.
I would make it with some checks on adding, if the product exists in the cart, to save it with some prefix (or suffix) on the ID. And to apply this condition only on the products that have no suffix. Something like that.
Cheers
That requires extra work when it comes to display the shopping cart items (adding/subtracting product quantity to be specific) since you are creating a whole new row, while in fact, it's the same product. I just wondering if there is any native way or integrated configuration for that. Thank you anyway
from laravelshoppingcart.
Related Issues (20)
- Apply multiple taxes HOT 1
- New package with improved cart performance
- Shopping configuration is not working
- Content of cart didn't return
- Update Cart Error When Update Only Work First Item HOT 4
- issue in getcartcontent - Object's Key/Value
- getPriceSum() in getSubTotalWithoutConditions() errors when summing
- update readme for laravel 8 and 9
- How to update quantity with decimal points
- Laravel 10 HOT 3
- Method Darryldecode\Cart\ItemCollection::getOrder does not exist.
- Cart Conditions HOT 2
- How to get all carts for analysis
- when is support for laravel 10 HOT 9
- Demo app is broken
- ¿How can I prevent the items in the cart from changing position? HOT 3
- How can I check the best-selling products? HOT 1
- when add product to card return last item added only
- Allow only one quantity per item and get response HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravelshoppingcart.