ECCUBEで税抜価格表示にする(EC-CUBE 2.13.2)

EC-CUBEの税込を「税抜」に変更する方法を紹介したいと思います。
ECCUBE2.13.2だと税抜にしたくてもプラグインなどで簡単にできません。

少し調べたら方法がみつかったので紹介したいと思います。

どのファイルを修正する?

  • 商品一覧ページ
  • 商品詳細ページ
  • 現在のカゴ(カート)の中
  • 商品購入/ご入力内容のご確認

上記の4つのファイルを修正します。
では修正していきましょう!

商品一覧ページ/商品詳細ページ

products/detail.tpl
products/list.tpl

1
2
3
4
5
6
7
8
9
10
11
<!--★販売価格★-->
<div class="price">
<!--{strip}-->
<!--{if $arrProduct.price02_min_inctax == $arrProduct.price02_max_inctax}-->
<!--{$arrProduct.price02_min_inctax|number_format}-->
<!--{else}-->
<!--{$arrProduct.price02_min_inctax|number_format}-->~<!--{$arrProduct.price02_max_inctax|number_format}-->
<!--{/if}-->
<!--{/strip}-->
円(税込)

上記の_inctaxをすべて削除します。

現在のカゴ(カート)の中

products/index.tpl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<table summary="商品情報">
    <col width="10%" />
    <col width="15%" />
    <col width="30%" />
    <col width="15%" />
    <col width="15%" />
    <col width="15%" />
    <tr>
        <th class="alignC">削除</th>
        <th class="alignC">商品写真</th>
        <th class="alignC">商品名</th>
        <th class="alignC">単価</th>
        <th class="alignC">数量</th>
        <th class="alignC">小計</th>
    </tr>
    <!--{foreach from=$cartItems[$key] item=item}-->
        <tr style="<!--{if $item.error}-->background-color: <!--{$smarty.const.ERR_COLOR|h}-->;<!--{/if}-->">
            <td class="alignC"><a href="?" onclick="eccube.fnFormModeSubmit('form<!--{$key|h}-->', 'delete', 'cart_no', '<!--{$item.cart_no|h}-->'); return false;">削除</a>
            </td>
            <td class="alignC">
            <!--{if $item.productsClass.main_image|strlen >= 1}-->
                <a class="expansion" target="_blank" href="<!--{$smarty.const.IMAGE_SAVE_URLPATH|h}--><!--{$item.productsClass.main_image|sfNoImageMainList|h}-->">
            <!--{/if}-->
                    <img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_list_image|sfNoImageMainList|h}-->" style="max-width: 65px;max-height: 65px;" alt="<!--{$item.productsClass.name|h}-->" />
                    <!--{if $item.productsClass.main_image|strlen >= 1}-->
                </a>
            <!--{/if}-->
            </td>
            <td><!--{* 商品名 *}--><strong><!--{$item.productsClass.name|h}--></strong>
                <!--{if $item.productsClass.classcategory_name1 != ""}-->
                    <div><!--{$item.productsClass.class_name1|h}-->:<!--{$item.productsClass.classcategory_name1|h}--></div>
                <!--{/if}-->
                <!--{if $item.productsClass.classcategory_name2 != ""}-->
                    <div><!--{$item.productsClass.class_name2|h}-->:<!--{$item.productsClass.classcategory_name2|h}--></div>
                <!--{/if}-->
            </td>
            <td class="alignR">
                <!--{if $smarty.const.PRICE_VIEW_TYPE == 0 || ($smarty.const.PRICE_VIEW_TYPE == 2 && $tpl_login === true)}-->
                <!--{$item.price|number_format|h}-->円
                <!--{else}-->
                    &minus;
                <!--{/if}-->
            </td>
            <td class="alignC"><!--{$item.quantity|h}-->
                <ul id="quantity_level">
                    <li><a href="?" onclick="eccube.fnFormModeSubmit('form<!--{$key|h}-->','up','cart_no','<!--{$item.cart_no|h}-->'); return false"><img src="<!--{$TPL_URLPATH|h}-->img/button/btn_plus.jpg" width="16" height="16" alt="+" /></a></li>
                    <!--{if $item.quantity > 1}-->
                        <li><a href="?" onclick="eccube.fnFormModeSubmit('form<!--{$key|h}-->','down','cart_no','<!--{$item.cart_no|h}-->'); return false"><img src="<!--{$TPL_URLPATH|h}-->img/button/btn_minus.jpg" width="16" height="16" alt="-" /></a></li>
                    <!--{/if}-->
                </ul>
            </td>
            <td class="alignR">
                <!--{if $smarty.const.PRICE_VIEW_TYPE == 0 || ($smarty.const.PRICE_VIEW_TYPE == 2 && $tpl_login === true)}-->
                    <!--{$item.total_inctax|number_format|h}-->円
                <!--{else}-->
                    &minus;
                <!--{/if}-->
            </td>
        </tr>
    <!--{/foreach}-->
    <tr>
        <th colspan="5" class="alignR">小計</th>
        <td class="alignR">
            <!--{if $smarty.const.PRICE_VIEW_TYPE == 0 || ($smarty.const.PRICE_VIEW_TYPE == 2 && $tpl_login === true)}-->
                <!--{$tpl_total_inctax[$key]-$tpl_total_tax[$key]|number_format|h}-->円
            <!--{else}-->
                &minus;
            <!--{/if}-->
        </td>
    </tr>
    <tr>
        <th colspan="5" class="alignR">合計</th>
        <td class="alignR">
            <span class="price">
                <!--{if $smarty.const.PRICE_VIEW_TYPE == 0 || ($smarty.const.PRICE_VIEW_TYPE == 2 && $tpl_login === true)}-->
                    <!--{$arrData[$key].total-$arrData[$key].deliv_fee|number_format|h}-->円
                <!--{else}-->
                    &minus;
                <!--{/if}-->
            </span>
        </td>
    </tr>
    <!--{if $smarty.const.USE_POINT !== false}-->
        <!--{if $arrData[$key].birth_point > 0}-->
            <tr>
                <th colspan="5" class="alignR">お誕生月ポイント</th>
                <td class="alignR"><!--{$arrData[$key].birth_point|number_format|h}-->pt</td>
            </tr>
        <!--{/if}-->
        <tr>
            <th colspan="5" class="alignR">今回加算ポイント</th>
            <td class="alignR"><!--{$arrData[$key].add_point|number_format|h}-->pt</td>
        </tr>
    <!--{/if}-->
</table>

こちらの「_inctax」を削除すると税抜になります。
逆に「_inctax」を入れれば税込になります。

商品購入/ご入力内容のご確認

products/index.tpl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
            <table summary="ご注文内容確認">
                <col width="10%" />
                <col width="40%" />
                <col width="20%" />
                <col width="10%" />
                <col width="20%" />
                <tr>
                    <th scope="col">商品写真</th>
                    <th scope="col">商品名</th>
                    <th scope="col">単価</th>
                    <th scope="col">数量</th>
                    <th scope="col">小計</th>
                </tr>
                <!--{foreach from=$arrCartItems item=item}-->
                    <tr>
                        <td class="alignC">
                            <a
                                <!--{if $item.productsClass.main_image|strlen >= 1}--> href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_image|sfNoImageMainList|h}-->" class="expansion" target="_blank"
                                <!--{/if}-->
                            >
                                <img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_list_image|sfNoImageMainList|h}-->" style="max-width: 65px;max-height: 65px;" alt="<!--{$item.productsClass.name|h}-->" /></a>
                        </td>
                        <td>
                            <ul>
                                <li><strong><!--{$item.productsClass.name|h}--></strong></li>
                                <!--{if $item.productsClass.classcategory_name1 != ""}-->
                                <li><!--{$item.productsClass.class_name1|h}-->:<!--{$item.productsClass.classcategory_name1|h}--></li>
                                <!--{/if}-->
                                <!--{if $item.productsClass.classcategory_name2 != ""}-->
                                <li><!--{$item.productsClass.class_name2|h}-->:<!--{$item.productsClass.classcategory_name2|h}--></li>
                                <!--{/if}-->
                            </ul>
                        </td>
                        <td class="alignR">
                            <!--{$item.price|number_format}-->円
                        </td>
                        <td class="alignR"><!--{$item.quantity|number_format}--></td>
                        <td class="alignR"><!--{$item.price*$item.quantity|number_format|h}-->円</td>
                         
                    </tr>
                <!--{/foreach}-->
                <tr>
                    <th colspan="4" class="alignR" scope="row">小計</th>
                    <td class="alignR"><!--{$tpl_total_inctax[$cartKey]-$tpl_total_tax[$cartKey]|number_format}-->円</td>
                </tr>
                <!--{if $smarty.const.USE_POINT !== false}-->
                    <!--{if $arrForm.use_point > 0}-->
                    <tr>
                        <th colspan="4" class="alignR" scope="row">値引き(ポイントご使用時)</th>
                        <td class="alignR">
                            <!--{assign var=discount value=`$arrForm.use_point*$smarty.const.POINT_VALUE`}-->
                            -<!--{$discount|number_format|default:0}-->円</td>
                    </tr>
                    <!--{/if}-->
                <!--{/if}-->
                                             
                            <tr>
    <th colspan="4" class="alignR">消費税</th>
    <td class="alignR"><!--{$tpl_total_tax[$cartKey]|number_format|h}-->円</td>
</tr>
 
                <tr>
                    <th colspan="4" class="alignR" scope="row">送料</th>
                    <td class="alignR"><!--{$arrForm.deliv_fee|number_format}-->円</td>
                </tr>
                <tr>
                    <th colspan="4" class="alignR" scope="row">手数料</th>
                    <td class="alignR"><!--{$arrForm.charge|number_format}-->円</td>
                </tr>
                <tr>
                    <th colspan="4" class="alignR" scope="row">合計</th>
                    <td class="alignR"><span class="price"><!--{$arrForm.payment_total|number_format}-->円</span></td>
                </tr>
            </table>

こちらは商品詳細を参考にして「-」「*」を使って計算していけば大丈夫です。
あとは「[$cartKey]」と「[$Key]」をちゃんと合わせて修正すればできます。

国の税金改正の年

国の税金改正の年は気を付けてください。
税金を変更する時は、「管理画面 → 基本情報管理 → 税率設定」という順で進んでいくと設定できるページがあります。
そちらで変更してください。

税抜設定のまとめ

PHPをいじるって事で躊躇してましたが、無事変更できてよかったです。
WEBサイトによって変更するページは増えたりすると思いますが、変更する箇所は同じようです。
メールの表記もわすれがちなのでなおしましょう!!

変更する際は、バックアップは必ずとってください!

参考にしたサイト

ECAREA

参考になりました。
ありがとうございます。