We can show the popup in plp and pdp page for the first time condition based on the cookies , if the cookies were not there the popup will show if the cookies were catched then the popup will not show
Define
‘js.cookie’
Function
cookie
_.extend(ProductDetailsFullView.prototype, {
initialize:_.wrap(ProductDetailsFullView.prototype.initialize,function(fn){
fn.apply(this,_.toArray(arguments).slice(1));
this.on(‘afterViewRender’, this.showPopupModel, this);
}),
showPopupModel:function () {
var showPopupPDP = cookie.get(“showPopupPDP”);
if (showPopupPDP !== true && showPopupPDP !== “true”) {
let view = new PromotionalpopupView();
view.useLayoutError = true;
container.getLayout().showInModal(view);
cookie.set(“showPopupPDP”, true, { expires: null });
}