Hi XTemos team!!
I’m trying to use one of your custom triggers on Quick Shopping, but it’s not properly timed in the theme code. Please see below…
On this file:
wp-content\themes\woodmart\js\functions.js
Function:
woodmartThemeModule.quickShop
There is a custom trigger that you guys implemented called:
woodmart-quick-view-displayed
That is really helpful and thank you for that!!
However, I think it needs some minor tweaks to work as it supposed to…
1- when the quick shop is already loaded and the ajax call is not needed, it also needs to trigger the event to let the observers know the quick shop is displayed.
Current:
if ($product.hasClass('quick-shop-loaded')) {
$product.addClass('quick-shop-shown');
return;
}
Needs to be:
if ($product.hasClass('quick-shop-loaded')) {
$product.addClass('quick-shop-shown');
$('body').trigger('woodmart-quick-view-displayed');
return;
}
2- the event needs to be triggered when the quick shop is effectively open.
Current:
success: function (data) {
// insert variations form
$content.append(data);
initVariationForm($product);
$('body').trigger('woodmart-quick-view-displayed');
woodmartThemeModule.swatchesVariations();
woodmartThemeModule.btnsToolTips();
},
complete: function () {
setTimeout(function () {
$this.removeClass(loadingClass);
$product.removeClass('wd-loading-quick-shop');
$product.addClass('quick-shop-shown quick-shop-loaded');
}, 100);
},
Needs to be:
success: function (data) {
// insert variations form
$content.append(data);
initVariationForm($product);
woodmartThemeModule.swatchesVariations();
woodmartThemeModule.btnsToolTips();
},
complete: function () {
setTimeout(function () {
$this.removeClass(loadingClass);
$product.removeClass('wd-loading-quick-shop');
$product.addClass('quick-shop-shown quick-shop-loaded');
$('body').trigger('woodmart-quick-view-displayed'); //moved to here
}, 100);
},
Please let me know if that makes sense.
It would be REALLY helpful for customization on this flow.
Would that be possible to have this fix on a next release please?
kind regards,
Wil