This tutorial demonstrates how to build a custom donation form that supports both once-off and recurring monthly donations. You’ll use
Oncord’s built-in form components and Commerce system to dynamically handle donation frequency and payment.
1) Enable Required Modules
Before creating the form, make sure the following modules are active:
Navigate to Settings > Features
Under Commerce, activate:
Commerce
Recurring Sales (Optional Features)
2) Paste the Form Code
You can add the donation form to a new or existing page. In the page editor, click Source in the left panel, then
paste the following HTML in the HTML section:
This form will generate a sales invoice with the product title “Donation”. If a user selects Monthly as
the frequency, it will also create a Recurring record for that customer.
The code is set to monthly recurring by default. You can change the recurring interval to weekly, yearly, or other supported intervals
based on your needs. Read more here.
3) Add Styling
To enhance the layout and improve usability, paste the following into your page’s CSS tab:
Note: This CSS is designed specifically for Oncord-based forms and works best when the Minimal form style is selected. If you’re using a different form style, the layout or behaviour might not appear as intended. Feel free to adjust or tweak the styles to suit your website’s design.
Final Notes
Using the CSS is optional – it’s provided to enhance the look of the form, but you’re free to use your own styling.
By default, the form redirects to Oncord’s Sales system page after submission. To send users to a custom thank-you or
confirmation page, update the onsubmitredirect="" value with your preferred URL.
Avoid changing the form ID or field IDs unless you’re confident with the structure. Modifying these without understanding
the logic may cause the form to stop working.
Ensure your payment gateway is connected under Commerce > Settings > Payment Gateways before testing
the form.