Search.../

getConfig( )

Retrieves the configuration of your validations extension.

Description

Set your validations configuration in the return of the getConfig() function. Wix calls this function when you publish your site. Changes to the configuration don't take effect until you publish your site.

By default, the Validations SPI only validates a site visitor's checkout. To also validate a site visitor's cart, set validateInCart to true.

Where to find getConfig()

When you add the Validations custom extension, a folder is automatically added to your site. Use the <my-extension-name>-config.js file in the folder to set the default configuration for your implementation of the custom extension.

For more information on setting your configuration, see Tutorial: Validations Custom Extension.

Syntax

function getConfig(): Promise<ValidationsConfigResponse>

getConfig Parameters

This function does not take any parameters.

Returns

Fulfilled - The configuration settings.

Return Type:

Promise<ValidationsConfigResponse>
NAME
TYPE
DESCRIPTION
validateInCart
boolean

Whether to validate the cart page in addition to the checkout page.

Default: false

Was this helpful?

Example of a configuration file

Copy Code
1// Place this code in the <my-extension-name>-config.js file
2// in the 'ecom-validations' folder of the
3// Custom Extensions section on your site.
4
5export function getConfig() {
6 return {
7 validateInCart: true
8 };
9};