Cannot change "continue shopping" link on "thank you" page

ckissi
Tourist
17 0 2

I'm trying to change the  "continue shopping" link on "thank you" page but it doesn't work. I've included the following code to the additional scripts section on checkout page settings.

<script>
(function() {
document.getElementsByClassName("step__footer__continue-btn")[0].href = "https://example.com/newlink";
})();
</script>

 

 Unfortunately, the node collections returned by the line below is always empty.

document.getElementsByClassName("step__footer__continue-btn")

 

The HTML part on the thank you page looks like this:

<a href="https://example.com/" data-trekkie-id="continue_shopping_button" class="step__footer__continue-btn btn">
 <span class="btn__content">Continue shopping</span>
 <svg class="icon-svg icon-svg--size-18 btn__spinner icon-svg--spinner-button" aria-hidden="true" focusable="false"> <use xlink:href="#spinner-button" /> </svg>
</a>

 

 Does Shopify somehow prevent me to make this change in the background?

Saurya
Excursionist
62 0 4

Did you found solution? Even I'm trying to look for how can the link be changed on Thank You page button (Continue Shopping from Homepage to the Collection)

Nirv-Sys
Tourist
3 0 0

me too...

0 Likes
Guleria
Shopify Partner
1463 301 416

Use this

document.addEventListener("DOMContentLoaded", function(){
document.getElementsByClassName("step__footer__continue-btn")[0].href = "your-url";
});


Thanks 

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
0 Likes