2

I have seen references to CiviDiscount on contribution pages for memberships. Can it be used for a fundraising dinner? Note - I often struggle between creating an event or contribution page for fundraising dinners - both have tradeoffs

  • What is the downside of an Event in this scenario? – petednz - fuzion Apr 1 '16 at 2:45
1

You can use Discount for event registrations too, assuming you mean the fundraising dinner is an event sign up?

  • No, the point is that it is a contribution page. not an event. – Sonicthoughts Nov 2 '15 at 18:49
  • 2
    Ok, so I'm not sure thats the desired behaviour of CiviDiscount, Contribution pages without Membership are in effect donation pages so giving a discount on a donation doesn't seem to make sense. You could simply point supporters to a different donation page which implied the discount or something along those lines with a module. – Parvez Saleh Nov 3 '15 at 8:48
  • 1
    I've had to work around this limitation at times, since I sometimes have a plain contribution page to buy a book or a t-shirt, with a member/code discount. In one case I duplicated/adapted the buildAmount function of cividiscount, and in one case I had to override the DiscountCalculator() because I didn't want to have to configure every single priceset-item. – bgm Aug 22 '17 at 13:11
  • @bgm can you share how you modified buildAmount function for applying discounts to a plain contribution page? I see it checks for page type but it gets confusing from there. – schatz Aug 1 at 7:34
  • @schatz OK, posted below as an answer. – bgm Aug 2 at 13:41
1

Here is a proof-of-concept extension that shows how to override bits of CiviDiscount to make it possible. It might be better to fix this in CiviDiscount itself, but meanwhile it's a good way to test and better define the requirements.

https://lab.civicrm.org/extensions/discountcontributions

This is copy-pasted code from a project. I tried to package it as an extension so that it can be re-usable, but I have not tested it at all. If you find it useful, please contribute to it. There are hardcoded Contribution Page IDs and PriceSet IDs, which should be converted to settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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