# サンクスページで「買い物を続ける」のではなくマイページに遷移させたい

**URL:** <https://community.shopify.com/t/topic/93064>\
**Category:** 技術的なQ＆A\
**Created:** [January 21, 2022, 6:27am UTC](https://community.shopify.com/t/topic/93064 "2022-01-21T06:27:38Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

サンクスページの「買い物を続ける」ボタンの遷移先をマイページ（アカウントページ）に変更したい。サンクスページ＝注文完了画面、href＝リンク先URL。

試した内容：追加スクリプトで step__footer__continue-btn の href を Liquid の条件（customer なら routes.account_url、未ログインなら routes.account_login_url）に設定。btn__content の文言変更は成功。

発生した事象：ボタンを押してもサンクスページに留まり、期待するページへ遷移しない。

解決策：href を '/account' に直接指定（continueBtn.href = '/account'）することで自己解決。

結論・現状：解決済み。追加の議論や未解決事項なし。

<div class="post-metadata">

**Author:** ![aiu777](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@aiu777](https://community.shopify.com/u/aiu777)\
**Post date:** [January 21, 2022, 6:27am UTC](https://community.shopify.com/t/topic/93064/1 "2022-01-21T06:27:38Z")

</div>

【実現したいこと】

サンクスページで「買い物を続ける」のではなくマイページに遷移させたいです。

追加スクリプトのスクリプトタグ内に以下を記述しました。

* * *

const continueBtn = document.getElementsByClassName(‘step\_\_footer\_\_continue-btn’)[0];

continueBtn.href = ‘{%- if customer -%}{{ routes.account\_url }}{%- else -%}{{ routes.account\_login\_url }}{%- endif -%}’;

const btnContent = document.getElementsByClassName(‘btn\_\_content’)[0];

btnContent.innerHTML = ‘この文字は変更できました’;

* * *

step\_\_footer\_\_continue-btnがボタンのaタグのクラスで

{%- if customer -%}{{ routes.account\_url }}{%- else -%}{{ routes.account\_login\_url }}{%- endif -%}はヘッダーのアカウントアイコンのhrefからコピペしました。

文字は変更できましたがボタンを押しても再度同じページ（サンクスページ）が表示されます。

【実現したいこと】を実現する方法について、ご教授いただけますと幸いです。

よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![aiu777](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@aiu777](https://community.shopify.com/u/aiu777)\
**Post date:** [January 21, 2022, 12:11pm UTC](https://community.shopify.com/t/topic/93064/2 "2022-01-21T12:11:45Z")

</div>

continueBtn.href = ‘/account’;

で自己解決しました
