Second button

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! :blush:

1 Like

Thanks for the idea, @Daniel_Parsons :wave:

Could you please specify what should happen after clicking on the Decline button?

1 Like

It would need to link to another page/url on my website

1 Like

Hi there, @Daniel_Parsons :wave:

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?

1 Like

Under the 1st button, same design as first button. Thank you so much!!

1 Like

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:

image

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 :slightly_smiling_face: