Skip to content

Extend it so other contribution pages can have discount code

Implemented a function to check if there is a discount code set for the price set or not. Display the code field based on the result. Remove the hardcoded ID and allow the discount to be applied on other pages.

So, the discount code field will be displayed on the contribution page if:

  • there is any discount code that set for this price set
  • there is any discount code which can be applied to any price set

Regardless of:

  • the discount code is invalid
  • the discount code is set for events/membership

In these two cases, the field will be shown but will be failed on validation step.

Before

The discount only works for a specific page

After

Discount works on all contribution pages

Comments

Can be better, but that is it for now.

Agileware ref: PROJ-1243

Edited by agileware_pengyi

Merge request reports