Closed martinlindhe closed 8 years ago
I've been thinking about this. I'm thinking about adding 'tax' and 'weight' (for shipping) in version 2, but still not sure how to implement it. It just feels wrong to me to keep adding extra parameters.
I'll keep this open for now.
While I solved my need for now, I'm still interested in this feature. And weight would also be very nice to have.
Some other laravel-related lib have this notion of extending models with extra properties, like EloquentSluggable does.
In the Shoppingcart case, one would normally have a Model that one wants to stick in the shopping cart, and by letting the model use a Shoppingcart trait and declare some mapping between columns and intention, it could be made quite clear.
Perhaps something like (just making stuff up)
class Product extends Model {
protected $cartMapping = [
'price' => 'price_excluding_taxes',
'vat' => 'tax_percentage',
'wgt' => 'weight',
'count' => 'stock',
];
...
I've been thinking about using traits for these kinds of things. I hope to find some time in the next few days to work on some ideas I have.
Thanks for the input!
sounds good :-) thanks
Any ideas on this?
I am looking for something similar. I am currently extending the Cart class with my own and added new attributes (like paymentmethod, shippingmethod, appliedTax,...)
However, the updateCart method doens't seem to store these extra attributes on the session.
Any help would be greatly appreciated!
What about implementing discount? Would be very nice to have the option to add only a single discount percentage.
@gjportegies Wondering if you were able to implement discounts?
That would be just awesome! I'm a junior developer working on my first project with laravel and just got @Crinsane 's cart integrated. THANKS for the open source code. I am building e-commerce website / app for a friend who wants discounts functionality integrated. As you might guess I got stuck and now I am researching all possibilities. All suggestions, links to useful resources to read / watch and ideas are deeply appreciated. (:
Since this has been an open issue for quite a while, if anyone needs this support use https://github.com/lukepolo/laracart
Tax is integrated in the new version which is currently in the master branch.
First, thanks for a great lib!
It would be useful to have a tax field that could hold the tax rate %, and some helpers to show price with or without tax, also total price with/without tax.
I'm in need of this feature and are thinking if i could extend this cart, or if it would be possible to improve on the lib to add this functionality. What do you think?