LogoLogo
Build appsContact API support
Storefronts
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
Storefronts
  • Ecwid storefronts overview
  • Get started
    • Storefront customization options
    • Quickstart: customize storefront with Ecwid JS API
  • Track Storefront events
    • "Page is loaded" events
    • "Customer logged in" event
    • "Cart details are changed" event
    • "New order is placed" event
    • "Instant Site section load" events
  • Get Storefront details
    • Get Ecwid store ID
    • Get storefront language and currency
    • Get visitor location
    • Get public app details
  • Manage customers on the storefront
    • Get logged in customer's details
    • Manage customer's cookie consent
    • Log out customer
  • Open page on the storefront
    • Overview of open page options
    • Open product pages with params
    • Open category pages with params
    • Open search page with params
    • Open account pages with params
  • Manage cart and checkout
    • Get cart details
    • Add product to the cart
    • Remove product from the cart
    • Fully clear the cart
    • Create pre-filled shopping carts
    • Calculate cart details
    • Send customer to the checkout
    • Set customer's email for the checkout
    • Set customer's comments for order
    • Set customer's shipping and billing addresses
    • Set custom order referer
  • Store configuration settings
    • Overview
    • Behavioral configs
    • Design configs

Lightspeed® 2025

On this page
  • Redirect after purchase
  • Custom scroll behavior
  • Set main store URL for widgets
  • Set storefront language for search engine crawlers

Was this helpful?

  1. Store configuration settings

Behavioral configs

Some store configuration settings allow you to change how Ecwid works on the website. These settings are useful when you integrate Ecwid storefront to a custom-built website.

Redirect after purchase

Use this config to redirect customers to a custom URL instead of the default "Thank you for purchase" page after a successful online payment.

Ecwid doesn't have any control over the custom pages. You need to build the page for this custom URL.

Code example:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();

window.ec.config.custom_redirect_after_purchase = 'https://mycoolstore.com/thank-you.html';

This method only works for online payment methods. If an order is paid with an offline payment method, customers won't be redirected to a specified URL.

Custom scroll behavior

This method allows you to set up a custom scroll position, disable auto-scroll, and create custom scroll behavior on your website. Check out the code examples below.

Set up a custom scroll position in px from page top:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();

window.ec.config.scroll_indent = 150; 

Disable auto-scroll on the page:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();

window.history.scrollRestoration = 'auto';
window.ec.config.navigation_scrolling = "DISABLED";

Apply custom scroll behavior:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();

window.ec.config.navigation_scrolling = "CUSTOM";
window.ec.config.custom_scroller = function() { 
	window.scrollTo(500, 0); //scroll to 500px from top
};

Set main store URL for widgets

This method is useful when you have a custom website with Ecwid storefront widgets on different pages. By default, these pages have independent carts, which is not convenient for customers.

Set one base URL for Ecwid widgets across all "secondary" pages on your website. As a result, all widgets will point to the checkout on the main store page.

Code example:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();
window.ec.config.store_main_page_url = "http://www.example.com/store.html";

Use case examples:

  • Create a one /store page and several pages showcasing specific products.

  • Integrate different categories from your store onto different website pages.

Set storefront language for search engine crawlers

Ecwid allows several translations for the same page, which helps with creating multilanguage websites.

However, search engines could get distracted by similar-looking pages. To help them index your website better, use our configs for automatic generation of the hreflang meta tags.

Force auto-generation of meta tags for the storefront by adding theenableHreflangTags and internationalPages configs.

  • enableHreflangTags enables generation of the hreflang meta tag.

Config example:

window.ec = window.ec || Object();
window.ec.config = window.ec.config || Object();
ec.config.storefrontUrls.enableHreflangTags = true;
ec.config.storefrontUrls.internationalPages = {
  "en": "https://site.com/store",
  "fr": "https://fr.site.com/store",
  "es-mx": "https://mx.site.com/store",
  "default": "https://site.com/store"
}

Last updated 2 months ago

Was this helpful?

Similarly to Ecwid.setStorefrontBaseUrl(), allows specifying a base store URL. Learn more about .

internationalPages sets URLs for storefront translations. Google Search Engine on 'locale' values.

recommendations
setting up base URL dynamically