Looking for some ideas about how to create create and utilize promotion or discount codes in NPSP. We will be utilizing an Experience Cloud site with a registration flow where users will be able to choose a membership level and submit payment through the flow. We will want to be able to create and provide promotion/discount codes to some users, so that they can enter them in the flow and receive an immediate discount. Some of the codes will be one-use codes and others will be provided to multiple people at a time. Thank you for any input!
@Elissa Stern I've seen this done in an Event App with custom metadata.
Essentially you create a custom metadata object called "Discount Codes". You add to it a field that stores the code "20OFF". You also can create a field that stores the percentage off, or dollar amount off. (you can do both, but it gets a little more complicated). Then a field for the expiration date. ( There is no reason you can't do a similar thing with a custom object, particularly if you have a large volume of these.) Something to keep in mind is that you are gonna want the "20OFF" to be a unique identifier within the expiration timeframe.
The tricky part is going to be providing a good UX in flow to actually check the discount. Without a custom LWC, it will be hard to mimic the UX you are familiar with at most checkouts. Click a button and get immediate feedback. ( It can be done though! but might not scale well if you have a large number of these active at one time.)
Anyway, the sketch of it would be, to take the discount code entered by the end user. Attempt to retrieve the custom metadata object (done using the standard GET records node), check if you found one, and that the expiration hasn't passed. If so apply the discount. If not display a message telling the user that the code doesn't exist or is expired!
Hope that helps!