Triggers
JavaScript API
Start, restart, and inspect tours with window.LCProductTour.
When tour assets are present, the loader exposes:
window.LCProductTour = {
start(tourId, options?),
restart(tourId),
getTours(),
};start(tourId, options?)
Starts a tour. Defaults to { force: true } so console/manual starts re-run even after show-once completion.
LCProductTour.start(12);
LCProductTour.start(12, { force: false });
LCProductTour.start(12, { force: true, keepMissing: true });If the tour is not already localized on the page, start fetches GET /wp-json/lcpt/v1/public-tours/{id} and then runs it (when the public endpoint and enqueue path allow).
Returns true, false, or a Promise that resolves to true/false when fetching.
restart(tourId)
Clears completion for the tour and starts it again.
getTours()
Returns a shallow copy of tours currently localized on the page.
Options
| Option | Meaning |
|---|---|
force | Ignore show-once (default true for start) |
clearCompletion | Remove stored completion before run |
keepMissing | Keep steps whose elements are missing instead of skipping when forced |
Any click trigger
Any element with data-lcpt-start="{tourId}" starts that tour on click — useful for theme buttons without shortcodes.