1

I have a client who'd like to give certain users an arbitrary discount or credit to be used to pay for a class. In these situations an admin will create the registration (using the Registration module) which will automatically create a cart with this class as a line item. I'm having trouble figuring out what process to use to (from the user's perspective) correct the price for the course in cart.

My understanding is that there's no way to modify the price for the line item directly. Assuming this is correct (if this isn't please let me know!), my research indicates I'll need to add a line item to the order that will (from the user's perspective) reduce the price to where they want it.

What should this line item be? A discount? A coupon? Something else? And, whatever the right "thing" is, how does it get applied?

I've tried installing commerce_discount and have set up a discount, but I cannot for the life of me figure out how to apply it to an order. I've read through the info on this page --> https://drupalcommerce.org/user-guide/discounts-and-coupons, but if the answer I'm looking for is in there, I'm not finding it.

I've also just installed commerce_account_balance thinking that might work, and I am still testing it, but it isn't clear it will be a good fit for my use case either.

My assumption is that others must be doing this and I just don't know enough about Commerce pricing to recognize the one or more helpful answers that are already out there (stack exchange or elsewhere)...

Any direction / thoughts / help on this will be much appreciated.

Thanks

(question originally posted here - it was suggested there that I post questions like this here...)

1 Answer 1

0

This sounds like a good use case for commerce_coupon + commerce_discount.

  1. Add these two modules (and dependencies).
  2. Add a new discount for an arbitrary % or $ off.
  3. Add a new coupon code for a particular user.

If the client wants to lock it down even more, you can modify the discount to specify a particular course/product that it applies to. You can also modify the coupon code to only apply to a particular user with a limited number of uses, date range it's valid for, and more.

You'll definitely want to add an "Order discount condition" to the discount to ensure that other products, shipping costs or donations are not discounted. Order discount conditions to include only registrations

Once the client has set up the discount and coupon code, they can send this to the user they need to give the discount to.


It's difficult to say where you're getting stuck applying the discount to the order, but I'd guess it has to do with the relationship between discount + coupon. At first I found it really confusing why discounts and coupons needed to be set in two different places.

It also appears that the commerce_discount module is incompatible with default configuration of commerce_account_balance. No matter how a coupon code is applied or how much of the total it supposedly reduced, it still requested a downpayment to cover the total (undiscounted) balance. It's likely this could be fixed by changing the order that the rules are executed so that the discount is run before the balance is checked.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.