Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Product Details data & events

The Product Details drop-in uses the Event Bus to emit and listen to events for communication between drop-ins and external integrations. For common events shared across multiple drop-ins (such as locale, error, authenticated, etc.), see the Common Events Reference.

Emits Reference

Events produced by this drop-in that you can subscribe to.

EventDirectionDescription
pdp/validEmitsEmitted when validation state changes

Listens Reference

Events this drop-in listens for from external sources.

EventDirectionDescription
pdp/setValuesListensFired by Pdp (pdp) when values are set programmatically

Emits and Listens Reference

Bidirectional events that both emit state changes and listen for external updates.

EventDirectionDescription
pdp/dataEmits and ListensTriggered when data is available or changes
pdp/valuesEmits and ListensTriggered when form or configuration values change

Event Details

The following sections provide detailed information about each event, including its direction, data payload structure, and usage examples.

pdp/valid (emits)

Emitted when validation state changes

Data payload

boolean

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const pdpValidListener = events.on('pdp/valid', (data) => {
console.log('pdp/valid event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
pdpValidListener.off();

pdp/setValues (listens)

Fired by Pdp (pdp) when values are set programmatically

Data payload

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const pdpSetValuesListener = events.on('pdp/setValues', (data) => {
console.log('pdp/setValues event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
pdpSetValuesListener.off();

pdp/data (emits and listens)

Triggered when data is available or changes

Data payload

ProductModel | null

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const pdpDataListener = events.on('pdp/data', (data) => {
console.log('pdp/data event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
pdpDataListener.off();

pdp/values (emits and listens)

Triggered when form or configuration values change

Data payload

ValuesModel

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const pdpValuesListener = events.on('pdp/values', (data) => {
console.log('pdp/values event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
pdpValuesListener.off();