cart icon indicating copy to clipboard operation
cart copied to clipboard

Coupon Functionality

Open dcolumbus opened this issue 12 years ago • 15 comments

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?

dcolumbus avatar Jun 05 '13 21:06 dcolumbus

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 [email protected] 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 .

chrisnharvey avatar Jun 05 '13 22:06 chrisnharvey

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! :/

dcolumbus avatar Jun 06 '13 01:06 dcolumbus

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.

jHoldroyd avatar Jun 06 '13 12:06 jHoldroyd

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.

dcolumbus avatar Jun 06 '13 17:06 dcolumbus

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?

chrisnharvey avatar Jun 07 '13 08:06 chrisnharvey

I'm going to get something for this in before v1. I think v1 will be out mid next week.

chrisnharvey avatar Jun 07 '13 18:06 chrisnharvey

@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? :)

dcolumbus avatar Jun 10 '13 16:06 dcolumbus

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.

jHoldroyd avatar Jun 10 '13 17:06 jHoldroyd

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.

dcolumbus avatar Jun 10 '13 18:06 dcolumbus

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 [email protected] 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 avatar Jun 10 '13 18:06 chrisnharvey

@chrisnharvey That sounds just great! It was just a thought... but I see your point completely. What would be an ETA on that method?

dcolumbus avatar Jun 10 '13 18:06 dcolumbus

What the status of the coupon functionality. Any plans to add it soon?

ispal avatar Aug 14 '13 08:08 ispal

Are there any news on this?

glesperance avatar May 05 '15 21:05 glesperance

+1

anaibol avatar Jun 23 '17 12:06 anaibol

Any updates on this one?

Gomah avatar Sep 06 '17 00:09 Gomah