Order custom fields

Order custom fields can easily be added into any form of the checkout flow. To add a custom field, you'll need to override the default templates. For instance, if you want to add a checkbox to the billing section to collect mailing list subscribers, you could do:

<billing section="bottom">
    <fieldset class="snipcart-form__set">
        <div class="snipcart-form__field">
            <div class="snipcart-form__field-checkbox">
                <snipcart-checkbox name="subscribeToNewsletter"></snipcart-checkbox>
                <snipcart-label class="snipcart__font--tiny snipcart-form__label--checkbox" for="subscribeToNewsletter">
                    Subscribe to newsletter
                </snipcart-label>
            </div>
        </div>
    </fieldset>
</billing>

It should look like this:

order-custom-fields

You can also add dropdowns:

<billing section="bottom">
    <fieldset class="snipcart-form__set">
        <div class="snipcart-form__field">
            <snipcart-label class="snipcart__font--tiny" for="customerType">
                Customer type
            </snipcart-label>
            <snipcart-select name="customerType" class="snipcart-form__select  snipcart__font--secondary snipcart__font--bold">
                <option value="Corporate">Corporate</option>
                <option value="Personal">Personal</option>
                <option value="NonProfit">Non-profit</option>
            </snipcart-select>
        </div>
    </fieldset>
</billing>

And textboxes:

<billing section="bottom">
    <fieldset class="snipcart-form__set">
        <div class="snipcart-form__field">
            <snipcart-label class="snipcart__font--tiny" for="vatNumber">
                VAT Number
            </snipcart-label>
            <snipcart-input name="vatNumber"></snipcart-input>
        </div>
    </fieldset>
</billing>

Custom fields are automatically added to the cart customFields object. They appear in the merchant dashboard as part of the order details.