❗️

Important:

This function is only compatible with Magento-based storefronts (Magento 1 & Magento 2).

swellAPI.setPathPrefix(pathPrefix)

By default, some Swell API calls communicate with your store's domain up to the top-level domain.

For example, in the URL: https://amazingstore.com/store, Swell API requests may only be sent to https://amazingstore.com and ignore any URL path following the top-level domain - in this case /store.

If your implementation requires API requests to be sent to a specific domain that includes a URL path/slug, you must inform the Swell API that these requests should be directed towards the specific path by calling the swellAPI.setPathPrefix(pathPrefix) function.

To do so, Set the URL path within the parenthesis following swellAPI.setPathPrefix
For example, https://amazingstore.com/store should look like the example below.

$(document).on("swell:initialized", function() {
  swellAPI.setPathPrefix('store');
});