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

Was this helpful?

  1. Open page on the storefront

Open product pages with params

Base JS call:

Ecwid.openPage('product', 'id': 72585497);

List of additional parameters for the call:

  • 'id' - Internal product ID. This is a required parameter for opening product pages.

  • 'name' - Product name for the URL in lowercase, with spaces replaced with dashes. For example, pizza-33cm.

  • 'slug_value' - Custom page slug for the product. Use it instead of the name parameter if a product has a custom slug.

  • 'variation' - Accepts product variation ID as a value to open a specific product variation.

  • 'options' - Accepts an array of product option choices (dropdown and radio button option types). Option choices are assigned to product options depending on the option index (starts at 1). For example, 'options': [3,1] selects the third value for the first option, and the first value for the second option.

If you pass both id and name or id and slug_value parameters, Ecwid JS API will create a product URL and open it without making additional backend requests to confirm the category exists. The choice between the name or slug_value parameters depends on whether a product has a custom slug.

Code examples:

Ecwid.openPage('product', {'id': 72585497, 'slug_value': 'best-toys'});

Ecwid.openPage('product', {'id': 45523512, 'name': 'Pizza Roll'});

Ecwid.openPage('product', {'id': 72585497, 'variation': 16351010});

Ecwid.openPage('product', {'id': 72585497, 'options': [2,2]});

There is an alternative way to open a page with pre-selected options or a variation without JS API. You can add option choices or the variation ID (?options=1,2,3 or ?variation=123456) as a query parameter to product page URLs and open it. URL examples: https://example.com/store/example-product?variation=163510 https://example.com/store/example-product?options=4,3

Last updated 2 months ago

Was this helpful?