Open dcolumbus opened 11 years ago
That's something I was thinking of adding myself. I'll get that done in the best few days. What would your dream API for this be?
Sent from my iPhone
On 5 Jun 2013, at 10:48 PM, Devin Columbus notifications@github.com wrote:
One thing that I'm in desperate need for is a Coupon functionality ... To be able to use a coupon to give a overall cart (or even product specific) discount.
What are your thoughts?
— Reply to this email directly or view it on GitHubhttps://github.com/moltin/cart/issues/6 .
I think it would be important to have the following abilities:
1) A product coupon with perhaps the possibility to override some options (of course, this depends on your application database schema). I usually add an "options" array to each product in the Cart. This way, if the coupon contained some options, I would let the coupon options override the product options. 2) An overall shop coupon. This could just be a total percentage or fixed dollar value taken off of the cart total.
That's as far as I can think at the moment and I wish this functionality was available today! :/
I don't think you'll ever see a coupon function in the cart, you'll more than likely see some sort of price modifier to do products or the whole cart by either a fixed or percentage value. It doesn't make any sense to put coupons into the cart, it's too specialised and would work much better in a package of its' own.
I completely disagree.
It makes perfect sense to put Coupons in the Cart. The Cart is what you end up using to "purchase", and if Taxes are within the cart, then so should discounts be.
If, however, it needs to become it's own package, it needs to interface seamlessly with the Cart.
Personally I think coupon functionality should be in this package, even if it's just a method named applyDiscount which you can either pass a percentage to or a fixed discount.
What do you think?
I'm going to get something for this in before v1. I think v1 will be out mid next week.
@chrisnharvey I absolutley agree that a method of some type that handles a coupon or discount should absolutely be in this package.
Maybe even a method that would look at a database table called "coupons" (with whatever columns you see fit) to verify the coupon/discount code. Of course, that could be done in a Route/Controller, but why not create the simple method to handle this? :)
I don't think you'll ever see that in this package, it's just not a fitting place to put it. A method to apply a discount makes sense, actual coupons, codes, etc. no way. That would be a separate package which would simply interface with the cart using the discount method available.
However it ends up being implemented, the point is to have coupon/discount functionality seamlessly interface with the Cart. Whether the methods are within the Cart class specifically doesn't really matter... but I also don't see why it would be a big deal to include them since they directly effect the cart.
This will be implemented, just not via a database. I'll add a method to apply a discount to the cart but you will have pull out your coupon codes from a database then pass the value over to the cart. The reason for this is because it is a framework/database agnostic package so adding features specific to Laravel or MySQL will remove that independence.
Sent from my iPhone
On 10 Jun 2013, at 07:30 PM, Devin Columbus notifications@github.com wrote:
However it ends up being implemented, the point is to have coupon/discount functionality seamlessly interface with the Cart. Whether the methods are within the Cart class specifically doesn't really matter... but I also don't see why it would be a big deal to include them since they directly effect the cart.
— Reply to this email directly or view it on GitHubhttps://github.com/moltin/cart/issues/6#issuecomment-19217312 .
@chrisnharvey That sounds just great! It was just a thought... but I see your point completely. What would be an ETA on that method?
What the status of the coupon functionality. Any plans to add it soon?
Are there any news on this?
+1
Any updates on this one?
One thing that I'm in desperate need for is a Coupon functionality ... To be able to use a coupon to give a overall cart (or even product specific) discount.
What are your thoughts?