Introduction

Note: This service plugin is currently in beta and is subject to change. Some service plugins are currently not available to all users.

The eCommerce Catalog service plugin (formerly SPI) is a service provider interface that provides functionality for implementing your own custom catalog of items and/or services to be sold on your site. Define how your custom catalog interacts with the eCommerce purchase flow in a way that is not currently supported natively by Wix. For example, you can determine the number of catalogs to choose from, provide a simplified catalog of products or services, and choose the products or services you wish to sell. The custom catalog can be used instead of, or alongside, a Wix Stores catalog.

Wix eCommerce calls the service plugin endpoint getCatalogItems() to retrieve the custom catalog's items. These items can then be displayed in dynamic product pages, as well as the cart, checkout, and order.

Learn more:

To add a service plugin

  1. Add the plugin to your site.
  2. Update the getConfig() function in the -config.js file that is added to your site during step 1.
  3. Update the getCatalogItems() function in the .js file that is added to your site during step 1.
Did this help?

getCatalogItems( )


Retrieves item data from a custom catalog.

This function is automatically called by Wix to retrieve the catalog items provided by your custom catalog plugin. This happens when certain actions are performed on the cart and/or checkout. For example, when an item is added to the cart.

Where to find getCatalogItems()

When you add the Catalog service plugin, a folder is automatically added to your site. Use the .js file in the folder to write the code to determine which catalog items to retrieve.

For more information on customizing your catalog plugin, see Velo Tutorial: eCommerce Catalog Service Plugin.

Method Declaration
Copy
Method Parameters
optionsOptionsRequired

Catalog and item references (IDs and additional info), weight unit, and quantities requested by Wix eCommerce.


contextContextRequired

Metadata about the request.

Returns
Return Type:Promise<Array<CatalogItems>>
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

getConfig( )


Retrieves the configuration of your catalog plugin.

Set your catalog 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.

Currently no configurations are available for this plugin, so set getConfig() to return an empty object.

Where to find getConfig()

When you add the Catalog service plugin, a folder is automatically added to your site. Use the -config.js file in the folder to set the default configuration for your implementation of the service plugin.

For more information on setting your configuration, see Velo Tutorial: eCommerce Catalog Service Plugin.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Promise<CatalogConfigResponse>
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?