Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Contributed modules
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Apr 2011 at 05:47 UTC
Updated:
7 Jul 2012 at 14:20 UTC
Comments
Comment #1
arbel commentedBatch Creation of coupons would be a required feature - if you want to create 100 - $50 one time discount coupons.
Please let me know if I can assist.
Idan
Comment #2
amateescu commentedI would also like to help out with this project.
Let me know if you start a sandbox project and if you want to collaborate on that :)
Comment #3
hunziker commentedHi amateescu
I create a new sandbox project. I like to collaborate with you. I would say that we create first the database structure and then we implement the features.
I have add the basic database schema. At the moment there are no restrictions on users, roles or products possible. Some question arises to me:
Are there any other use case, we should consider?
Comment #4
heyyo commentedA nice idea about coupons is the possibility to receive coupons if we invite people which become buyer.
Have a look to this ubercart module:
http://drupal.org/project/uc_invite_discount
Comment #5
hunziker commentedIm not sure how to approach such a functionality like UC Invite Discount. A possible approach can be to setup a rule, which checks if the buyer is invited by another user. (The linking between this user can be done by using the reference field.) If the buyer is invited a new coupon for the inviter is created.
My conclusion is that, we need a good integration with Rules, then we can accomplish many use cases.
Comment #6
arbel commentedI think the ability to sell a coupon is important, because then we can have gift certificates.
Idan
Comment #7
amateescu commented@hunziker in #3:
1. I think we should try doing that with rules.
2. No, i don't see any use case for coupon types.
3. Yes, the ability to sell coupons is a good feature to have :)
@hunziker in #5:
That's a very good idea, we can use http://drupal.org/project/nodereference_url to autocomplete the user reference field.
Comment #8
aem34 commentedas well please :
- for a category, or some categories, (taxonomy ?)
- for a product type, or some product types
because there's also a need for example when a customer returns a product,
or there isn't the product the customer wants in stock,
and the seller wants to offer a reduction coupon specifically
on the same category of product for the customer
for him to choose another article from the same category for example...
sorry i don't know how an "avoir" (french) is called in english...
Comment #9
amateescu commented@aem34, this is what hunziker was talking about in #3. So we'll provide support for coupons to be available only for certain product types, taxonomy terms and user roles.
Comment #10
hunziker commentedThank to all for all this response.
There are many use cases. I try to summaries them up here:
I would say that a general approach is needed to accomplish the requirements derived from the use cases. Therefore I propose the following implementation:
We add a coupon type which is fieldable. In core we have only the field coupon id, the coupon amount and some admin information. All other data is stored in the fields. These date can be easily accessed by the rules. The rules can then control when a coupon is valid or not.
An example: Restrict the use of a coupon to a certain category
We insert a new coupon type called "Category restricted coupon". We add a field "category" to this type. The field can be referenced to the category.
We create a new coupon which is referenced to a certain category. The customer validates the coupon. Now we invoke a rule. The rule iterates over the products in the cart. Each product is check if the product is in the same category as the coupon requires. The result of this check is return to the validation method.
With this generic approach we can cover must of the use cases and we can easily extend it. It is also possible that we provide some default coupon types, which cover some of the use cases. The user can then see how the implementation works and can extend or modify the system as he needs.
Comment #11
rszrama commentedA few notes from me, as I've given this a fair amount of thought and have "planted seeds" waiting for someone to really give this a shot. : )
I'd say make your 1.0 target the basic coupon functionality. It doesn't need to accommodate everything (i.e. randomly generated, single use redemption codes or purchasable coupons - imo, gift certificates should be handled separately anyways, as they introduce a store-specific currency). I'd just aim to solve the very basic tasks of:
I'm not sure exactly how you should handle product vs. order coupons. It may be that you end up needing a new line item type to accommodate order based coupons, as there isn't a place to calculate those through the product pricing rules.
I've always thought that we should be able to just integrate the application of a coupon to a product through Rules, but now that I think about it a little more, I think it may be more complicated since that system isn't setup to handle an order's final price... Bummer.
Comment #12
hunziker commentedRyan thank you for your inputs.
I thought also some time about it. As you said, our target must be to build a basic module, that can handle some simple cases. But this module must be expendable to more complicated cases.
About your points:
We have some more problems we did not consider yet:
Are there any suggestions for implementing the above functionality?
Comment #13
rszrama commentedYeah, for your #1, it shouldn't be a problem... on sites where this is a possibility, people just need to add a condition to check the order total in the rules that enable payment methods. If no payment methods are returned, then the customer doesn't have to specify anything... it may be that it's more user friendly to actually display a "Your order is free" type of message, so in that regard we might just want to produce a contributed module similar to my UC Free Order payment method module for Ubercart... it'd just be a lot more lightweight for DC.
For #2, I'd say don't even go there. Coupons aren't generally multi-transactional. What you're describing sounds more like a gift card to me, where you get a balance that you can subtract from the order total on X number of transactions. That to me should be the domain of a different module altogether, because then you'd need payment method and customer UI support so they can see when orders are paid by "store credit" and how much they have remaining. I really think the coupon module should only focus on discount coupons, and if someone wants a "coupon code" type method of granting store credit, then that can be accommodated through a separate store credit module.
Comment #14
BenK commentedSubscribing
Comment #15
hunziker commentedSo I think we have plan. We should implement in a first release the following functionalities:
In second release we can cover some additional functionalities, such as:
We should discourse the "store credit" thing later. As Ryan said we should focus on the basic functionality in a first step. Is that all or should we add something?
Comment #16
arbel commentedI feel I can create the payment free method.
Idan
Comment #17
hunziker commentedHi Idan
This would be nice, if you can create the free payment method.
Comment #18
rszrama commentedYou can almost just straight copy the Example Payment Method module in core and rename some things.
Comment #19
arbel commentedyeh, i did something simliar for a site i'm working on.
Idan
Comment #20
hunziker commentedI have check in a version that covers point #1 to #4 of post #15.
It would be nice if someone can review the code. Known issues:
Comment #21
bojanz commentedThe uninstall problem might be due to the core bug: #1029606: Regression: Not loading the .module file causes a fatal error when uninstalling some modules (as does loading it)
Comment #22
hunziker commentedI have implemented the validation process with rules. Now I am at the implementing of the redeem process.
I studied the tax module as propose by Ryan. Now I have to following problem:
The hook_commerce_price_component_type_info() hook provides the possibility to add a price component. This price component is invoked for all order lines. For percentages coupons this makes sense. For fixed amount coupons it makes no sense, because you add it to the whole order or not at all.
So it would make sense to enable the price component only for percentage coupons. But this leads us to the next problem: When we have some special marketing event with 1000 coupons, we do not want to configure for each of them the price component. So we like to do it for the coupon type. When we do so, we cant set the amount type in the coupon, we need to set in the type.
My question is should we go this way and move the "is a percentage" coupon to the coupon type? Is it a good idea to derive the price component from the "is percentage" field?
Any suggestions are very welcome!
Comment #23
hunziker commentedI have look more deep into the tax module and the way the tax calculation is handled. As my previous post shows we have a slightly different calculation for percentage and fixed amounts. The percentage could be implemented by the approach of the tax module, but for the fixed amounts we fail with tax approach.
So I look into the shipping module. There we have an approach which is for my opinion much better, because we can handle also fixed amounts. I do not want to implement two separated approaches for fixed and percentage amount calculation. This becomes to complicated for the user to handle.
Ryan, I know you know much about the Commerce Module. Can you state your opinion about this? Thank you.
Comment #24
rfayIf there's some code, let's get it into a sandbox or a project. I'm happy to help any way I can.
Comment #25
hunziker commentedThere is already a project and some code:
Commerce Coupon
Comment #26
rfayExcellent! Marking this as a duplicate.
Let's get that promoted to a full project. I see you have a full project application at http://drupal.org/node/1088152 - I'll see if I can review it and let's get Commerce Coupon promoted.
Comment #27
hunziker commentedI promote the project to a full project. I don't put any release, because it is definitively not ready for production.
I would propose to discuss the next steps and implementation problems directly in the project issue queue. So we can discuss the different problems, bugs and task separately.
Currently the main issue for me is the implementation of the order total reduction: #1127588: Implementation of coupon redemption
Comment #28
rfayYay hunziker: http://drupal.org/project/commerce_coupon
Thanks!
Comment #29
rfayThink "fixed" is a better status.
Comment #30
hunziker commentedThe last commit of my module is ready for testing. Any feedback is welcome. Tomorrow a dev release is available. Know issues:
Comment #31
hunziker commentedI have add a new version. Here are the details: #1127588: Implementation of coupon redemption
If someone what to support the project, she / he is very welcome. Open issues:
So if someone to pitch in, please let me know.
Comment #33
m.attar commentedI have a problem that to reference a coupon with a commercial product
Cenario
1 - create a coupon (use coupon basic)
2-create a product type ('product commerce')
3 - I add a field of type 'coupon reference' (a product type)
4-create a product (insert all fields)
problem
in the 'coupon reference'
1 - I do not know what I should fill out (field 'coupon reference') ex: name of the coupon or coupon code or other
2-If I fill in for some value I click on the button save the fields not to take any value.
Can someone help me please.
thank you
Comment #34
kiwimind commented@attar_eweev, I would suggest starting a new issue thread as this one is closed, so won't be noticed.
Comment #35
vako commentedJust take a look at the 'matured' coupon options in Ubercart and do the same.