A second button to accept and decline the offer would be great
Share your use case and provide as many details to support your idea as possible. Thank you!
A second button to accept and decline the offer would be great
Share your use case and provide as many details to support your idea as possible. Thank you!
Thanks for the idea, @Daniel_Parsons
Could you please specify what should happen after clicking on the Decline button?
It would need to link to another page/url on my website
Hi there, @Daniel_Parsons
Our devs confirmed that it’s possible to create a 2nd button. Could you just specify where you’d like to place (under the 1st button or maybe make the 1st button smaller and put the 2nd one on the right? Should it also have the same design as the 1st button?
Under the 1st button, same design as first button. Thank you so much!!
We’ve added this code to the Custom JS section on the Settings tab of your widget’s settings:
const LINK_TEXT = 'Link text';
const LINK = 'https://www.google.com';
const waitForElement = (selector, root = document) => new Promise(res => {
let i = 0;
const check = () => {
const component = root.querySelector(selector);
if (component) {
res(component);
} else if (i !== 50) {
setTimeout(check, 100);
i++;
}
};
check();
});
waitForElement("[class*='cta__Container-sc']")
.then(() => {
const button = document.querySelector("[class*='cta__Container-sc']");
const newButtonBody = button.cloneNode(true);
button.append(newButtonBody);
const newButton = newButtonBody.querySelector('button');
newButton.querySelector('span span').textContent = LINK_TEXT;
newButton.addEventListener('click', () => {
window.open(LINK, '__blank');
});
});
Do not forget to set the correct link and link text (button text) in the first 2 lines of the code:
Note: The button won’t be displayed in the configurator, but it will appear on your website.
Please check it and let me know if you like the result