Skip to main content

Add A Form Template

A form template is a default set of form fields for a particular form. This lets the user choose between a few types of checkout forms that are "pre-made", that they can edit and customize, vs creating their own from scratch. The user will be prompted to choose a template when they create a checkout form.

If you wish to create a form that a user cannot edit, you may want to try creating a Static Form instead.

Register Your Form Template

You can register your form template using SureCarts surecart_register_form_template function:

surecart_register_form_template([
'name' => 'Donation Form',
'category' => 'Donation',
'post_type' => 'any',
'template' => [
[ "surecart/pricing-section",
[
'label' => 'My Label',
'columns' = 2
]
],
[ "surecart/contact-section" ],
[ "surecart/payment-section" ],
[ "surecart/totals-section" ],
[ "surecart/submit" ]
]
]);