Customizing Newsletter Form

Solved
callmelyzz
Tourist
10 0 2

Hello! I'm trying to customize our newsletter form on our password page. I've attached a photo of what we'd like to changed (changes in red). Could anyone help with what line of code/what I have to do to achieve the results we want? Thank you! Screen Shot 2021-02-03 at 11.25.19 AM.png

0 Likes

Hello,

Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes

This is an accepted solution.

 

Hey,

Thanks! Ideally I'd need to be within your theme to make a more appropriate change, but this will do.

1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:

 

<script>
function changePasswordPageText(){


var inputText = "Enter Your Email";
var buttonText = "Sign Me Up"

if (window.theme.template !== 'password'){return;}




var $input = document.querySelector(`.Password__Content [name="contact[email]"]`);

if (!$input) {return;}

var $btn = document.querySelector(`.Password__Content .Form__Group button`);

if (!$btn) {return;}

$input.setAttribute('placeholder', inputText);

$btn.textContent = buttonText;


}
changePasswordPageText();
</script>

 


You can change the text as per your wish. Just change the text between quotes:

diego_ezfy_0-1612367906797.png

 



Please let me know whether it works.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes
callmelyzz
Tourist
10 0 2

Hey Diego! Thank you for trying to find a solution, it's greatly appreciated. Unfortunately, this did not work. The newsletter subscription on our password page is the same. I've attached a photo! Do you think there's another solution to this? 

Screen Shot 2021-02-03 at 12.03.05 PM.png

0 Likes

@callmelyzz 

I'm inspecting your website's code and the script is not added in - did you press the button "save" after adding the script?

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes
callmelyzz
Tourist
10 0 2

Hi Diego! thank you for your help. The problem has been fixed

0 Likes

@callmelyzz 

Nice, I'm glad to hear!

Next time feel free to contact me personally, I'll be happy to help.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes