Re: Need special link with Popup

How can I create a special link with a discount popup?

Shopify Partner
15 0 3

Hi. I want to create a special link.

if user clicks on it, he lands at the homepage with a special popup "Here is 10% discount #SPRING10"


is this possible? with an app or smth?

Reply 1 (1)

Shopify Partner
324 19 89

Hi Kiwi8,


You can probably use an app for this, but the simplest way might be adding some code to your theme.


You can add this snippet to your homepage Liquid template:


{% if request.path == '/speciallink10' %}
// `document.addEventListener('DOMContentLoaded', ...) tells the browser to do something after the page has finished loading.
document.addEventListener('DOMContentLoaded', function() {
  // The simplest way to display a message is with `alert`, but there are better ways if you know HTML.
  alert('Here is 10% discount #SPRING10');
{% endif %}


That being said, you will probably also have to set up your site to display the homepage template when the URL path is '/speciallink10'.