How to change click on inline tile behaviour to redirect to PDP in a Widget
Overview
Getting Started
Create a Widget
For Grid, Masonry, Nightfall, Slider and Quadrant widgets.
$(document).on('widget:ready', function (e, instance) {
instance
.on('beforeAppend', function (e, $tile, tileData, $appendRoot) {
const productTags = tileData.tags_extended.filter(tag => tag.type === 'product' && tag.custom_url);
if (productTags && productTags.length) {
$tile[0].onclick = () => window.top.location.href = productTags[0].custom_url;
}
});
});For Waterfall and Carousel widgets.
PreviousHow to use Filter and search in a WidgetNextStyling cross-sellers on Grid and Carousel Widgets
Last updated