Skip to main content
Contributor I
May 18, 2024
Solved

Secret Sale Pop Up

  • May 18, 2024
  • 2 replies
  • 136 views

I would like to have a secret sale event for email subscribers while encouraging new visitors to subscribe for access. I’ve created the collection and the full page pop up for just that collection, but there's nothing keeping visitors from just x-ing out of the pop up to view/ order from the collection. How can I make the ‘X’ redirect to the home page so that the sale is truly exclusive to subscribers and those who sign up? Additionally, how can I make the ‘X’ in the success pop up direct straight to the secret sale?

    This topic has been closed for replies.
    Best answer by LautaroNores

    To make sure only subscribers get access to your secret sale, you can tweak the 'X' button on your pop-up. When someone clicks 'X', you can redirect them to the home page using a little JavaScript magic. Similarly, for the success pop-up, you can make the 'X' button lead straight to the secret sale page.

    Here's how you can do it:

    For the 'X' button in the main pop-up:
    document.getElementById('popup-close-button').addEventListener('click', function() {
      window.location.href = '/';
    });
     

    And for the 'X' button in the success pop-up:
    document.getElementById('success-popup-close-button').addEventListener('click', function() {
      window.location.href = '/secret-sale';
    });
     

    Just replace 'popup-close-button' and 'success-popup-close-button' with the actual IDs of your close buttons.

    Hope this helps!

    2 replies

    Contributor I
    May 18, 2024

    To make sure only subscribers get access to your secret sale, you can tweak the 'X' button on your pop-up. When someone clicks 'X', you can redirect them to the home page using a little JavaScript magic. Similarly, for the success pop-up, you can make the 'X' button lead straight to the secret sale page.

    Here's how you can do it:

    For the 'X' button in the main pop-up:
    document.getElementById('popup-close-button').addEventListener('click', function() {
      window.location.href = '/';
    });
     

    And for the 'X' button in the success pop-up:
    document.getElementById('success-popup-close-button').addEventListener('click', function() {
      window.location.href = '/secret-sale';
    });
     

    Just replace 'popup-close-button' and 'success-popup-close-button' with the actual IDs of your close buttons.

    Hope this helps!

    EmiLaneAuthor
    Contributor I
    May 18, 2024

    This is really helpful, thank you! I can't figure out where to put the code though.