In this article, we will cover:
By default, the form is displayed in a collapsed state, and the customer has to expand the form to fill out their VAT number. This is the preferred behavior for online stores that serve both businesses and private customers, as the second group typically skips the VAT form.
If you want to display the expanded form for each customer, when inserting the code for specific forms, add an { alwaysVisible: true } parameter to the code. For example, to place an expanded form on your store's cart page, copy and paste the following code to the form's initialization snippet:
In rare cases, when you are using multiple apps in your Shopify store, a different app may prevent the Sufio VAT form from automatically validating the customer's VAT number.
If this happens to you, you can add a Save button to your form. This way, the customer first saves their VAT number, sees the result of the validation, and then continues with their flow.
To display the Save button, when inserting the code for specific forms, add a { saveButtonEnabled: true } parameter to the code. An example below shows a code that places the form on your store's cart page with the Save button added.
The Save button doesn’t change whether the form is collapsed or expanded. On the cart page, the VAT number is then validated only when the customer clicks on the Save button, not when they click on the checkout button.
You may want to customize the design of the VAT registration form to match the design of your store. The theme.liquid file accepts modifications in the CSS format.
To change the registration form design:
- In your Shopify admin, go to the Online Store → Themes page.
- Click the Actions button, then click Edit code.
- In the theme.liquid file, just above the initialization script, add
<style></style>tags. - Inside the tags, type the desired element and its parameters in the CSS format. You may use your browser inspector feature to find out the names of the elements.
- Click Save to apply the changes.
The following example changes the Save button color to green.
The following example changes the VAT number input field border color to light grey.
By default, Sufio places the VAT registration form next to an element that is already on the page:
- Customer registration page: just above the button that submits the registration form
- Customer account page: just below the link to the customer’s addresses
- Cart page: just above the checkout button, including the checkout button in the cart drawer
If you are not happy with the default placement of the VAT registration form on the Shopify pages, you can further specify the placement of the form.
- In your Shopify admin, go to the Online Store → Themes page.
- Click the Actions button, then click Edit code.
- Choose the one or more of the placement possibilities you want to customize: the Customer registration page, the Customer account page, or the Cart page.
- Using the parameters below, open the respective Shopify theme file from the left sidebar and copy and paste the Code snippet inside the code, to the place where you want the VAT registration form to be displayed.
- Click Save to apply the changes.
- Navigate to Layout → theme.liquid and just above the ending
</script>tag of the initialization code snippet, copy and paste the Initialization script snippet for that page, listed below. - Click Save to apply the changes.
- Shopify theme file: Sections → main-register.liquid
- Code snippet:
<div id="register-vat-form"></div> - Initialization script snippet:
- Shopify theme file: Sections → main-account.liquid
- Code snippet:
<div id="account-vat-form"></div> - Initialization script snippet:
- Shopify theme file: Sections → main-cart-items.liquid
- Code snippet:
<div id="cart-page-vat-form"></div> - Initialization script snippet:
For example, if you decided to edit the placement of all the VAT registration forms, the resulting initialization script will look like this:
Need help?
Do you need help with customizing your Shopify store theme? Please contact our experienced support team. We'll be happy to assist!