Shopify themes, liquid, logos, and UX
Hi there
How to redirect subscribe form /challenge#footer-newsletter once it submit go a thank you page
Thanks in advance!
I found the answer redirect add this code in theme.liquid in the bottom just change the ID
<script>
$(document).ready(function(){
var $returnTo = $('<input type="hidden" name="return_to" value="/pages/thank-you"/>');
if ($('#footer-newsletter').length > 0){ //if form
$returnTo.insertBefore($('#footer-newsletter input[type="submit"]')); // add return_to input
} else if ($('#newsletter-popup').length > 0){ //if form
$returnTo.insertBefore($('#newsletter-popup input[type="submit"]')); // add return_to input
} else if ($('#g-recaptcha').length){ //if captcha form
$returnTo.insertBefore($('.shopify-challenge__container input[type="submit"]'));
}
});
</script>
Hi, I'm new to this, would like to ask what ID is supposed to be changed in the code?
hey this is great, how does it work? Trying to do this on the Debut theme. What ID are we supposed to change?
Thanks!
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024