Re:

How to link sign up in the announcement bar - Dawn theme

IndujaAIKY
Excursionist
43 0 5

Hello  All 

I am using Shopify Theme Dawn and I am trying to add a link to my announcement bar so when customers click on it, it scrolls all the way to the bottom of the page so customers can sign up. Or it re opens my Newsletter sign up 'pop up'.

 

Can anyway help advise I can do this?

 

Thank you 

 

 

Replies 4 (4)

shraddha_patel
Shopify Partner
155 24 23

Hello, 

 

May I have your store url please?

Need more help with theme customization and store development ? You can Reach me here
Or Text me

PageFly-Victor
Shopify Partner
7865 1786 3133

Hi @IndujaAIKY,

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at bottom of the file -> Save

 

<script>
window.addEventListener('DOMContentLoaded',(event)=>{
document.querySelector('.announcement-bar__message').onclick=()=>{
window.scrollTo({
  top: document.documentElement.scrollHeight,
  behavior: 'smooth' // Adds a smooth scrolling effect
});
}
});
</script>

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

dstewart
Tourist
6 0 1

Is there a way to click on the announcement and it shows the pop up to sign up to newsletter?

 

the solution above will allow you to click the announcement and takes to you the bottom of the page where email sign up shows. How about clicking the announcement and displaying the pop up box?

Redroot_Blades
Excursionist
23 3 5

Works perfectly, except that the cursor doesn't change to the pointer. It has the text icon. Would you add  that to the script for us please?