Simplify message wrapper rendering and add shop, home locations

This commit is contained in:
Alex P 2023-10-16 21:41:17 +03:00
parent 0062f20c7a
commit 7da5d8d68a
No known key found for this signature in database
GPG key ID: 54487A734A204D71
6 changed files with 328 additions and 45 deletions

View file

@ -1,7 +1,7 @@
document.addEventListener(
'DOMContentLoaded',
() => {
const payLaterMessagingSelectableLocations = ['product', 'cart', 'checkout'];
const payLaterMessagingSelectableLocations = ['product', 'cart', 'checkout', 'shop', 'home'];
const payLaterMessagingAllLocations = payLaterMessagingSelectableLocations.concat('general');
const payLaterMessagingLocationsSelector = '#field-pay_later_messaging_locations';
const payLaterMessagingLocationsSelect = payLaterMessagingLocationsSelector + ' select';
@ -9,7 +9,7 @@ document.addEventListener(
const smartButtonLocationsSelector = '#field-smart_button_locations';
const smartButtonLocationsSelect = smartButtonLocationsSelector + ' select';
const smartButtonSelectableLocations = payLaterMessagingSelectableLocations.concat('mini-cart');
const smartButtonSelectableLocations = ['product', 'cart', 'checkout', 'mini-cart'];
const groupToggle = (selector, group) => {
const toggleElement = document.querySelector(selector);