diff --git a/blocks/product-details/product-details.js b/blocks/product-details/product-details.js index 4125f0e99..6ae1fa06d 100644 --- a/blocks/product-details/product-details.js +++ b/blocks/product-details/product-details.js @@ -30,7 +30,7 @@ import '../../scripts/initializers/cart.js'; export default async function decorate(block) { // eslint-disable-next-line no-underscore-dangle - const product = events._lastEvent?.['pdp/data']?.payload ?? null; + const product = events.lastPayload('pdp/data') ?? null; const labels = await fetchPlaceholders(); // Layout