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 category pages with params

Base JS call:

Ecwid.openPage('category');

List of additional parameters for the call:

  • 'id' - Category ID. If not specified, Ecwid will ignore any other params and open the main (root) category page (same as 'id': 0).

  • 'name' - Category name as it would look in the URL: lowercase, spaces replaced with dashes. For example, the "Rental Spaces" category name would transform into rental-spaces.

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

  • 'page' - Page number for categories where products don't fit on one page. If you pass a value bigger than the number of pages in the category, Ecwid will open the last page.

If you pass both id and name or id and slug_value parameters, Ecwid JS API will create a category 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 category has a custom slug.

Code example:

Ecwid.openPage('category', {'id': 20671017, slug_value: 'rental', 'page': 2});

You can also open the side menu with product filters on category pages with the Ecwid.showProductFilters(); call.

Code example:

Ecwid.openPage('category', 'id': 20671017);

Ecwid.showProductFilters();

Last updated 2 months ago

Was this helpful?