Dawnを利用しています。
カートに商品を追加した際に表示される”配送料は購入手続き時に計算されます ”を削除したい
のですが、どうすればよいでしょうか? Dawnのコード編集方法を教えてください。
dawnの最新バージョンである5.0を例に説明します。
お使いのdawnのバージョンによっては、コードが少し異なるかもしれません。
やり方はいくつかあり、
一番簡単なのは、
言語設定ファイルから該当の日本語を削除する、という方法です。
しかし、こちらは、その表記が必要な場所からも表記を消してしまう恐れがあるので、
お勧めいたしません。
ですので、コードの編集方法をご説明しますが、
もし、コード編集に慣れていらっしゃらないようでしたら、
念の為、
管理画面 > オンラインストア > テーマ > 現在のテーマの「アクション」から「複製」をクリック
して、必ず、現状のテーマの複製を作って下記に進んでください。
もし、操作を誤られたり、私が提示した内容に誤りがあったとしても、
複製したテーマを「メインテーマとして設定」すれば、
元に戻ります。
前置きが長くなりましたが、手順は下記です。
管理画面 > オンラインストア > テーマ > 現在のテーマの「アクション」から「コードを編集」クリック
ここままででコード編集のためのエディタ画面が開いたはずです。
次に、Layout, Templateなどのフォルダのような表記がある場所から、Sectionsを探します。
さらに、Sectionsの中に、cart-drawers.liquid というものがあると思います。
そちらが目的のファイルになりますので、クリックしてください。
コードがエディタ内に展開されると思いますので、
284行目(Dawnのバージョンによっては行数が異なるかもしれません)に、下記のコードが見つかるかと思います。
<small class="tax-note caption-large rte">
{%- if cart.taxes_included and shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- elsif cart.taxes_included -%}
{{ 'sections.cart.taxes_included_but_shipping_at_checkout' | t }}
{%- elsif shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
{%- else -%}
{{ 'sections.cart.taxes_and_shipping_at_checkout' | t }}
{%- endif -%}
</small>
こちらの内容を下記の内容で上書きします。
{% comment %}
<small class="tax-note caption-large rte">
{%- if cart.taxes_included and shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- elsif cart.taxes_included -%}
{{ 'sections.cart.taxes_included_but_shipping_at_checkout' | t }}
{%- elsif shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
{%- else -%}
{{ 'sections.cart.taxes_and_shipping_at_checkout' | t }}
{%- endif -%}
</small>
{% endcomment %}
「保存する」をクリックいただきますと、目的の文言を削除できるはずです。
(キュー田辺)