[eccube3]送料無料条件表示プラグインをいじる

要るのかなという気持ちもある。

プラグイン

3.0系|送料無料条件表示プラグイン|株式会社シロハチ

説明文にもあるけど、ある程度触ってると表示の仕方も分かってくるんだよね。どうなんでしょうね。

表示場所を変更する

表示の設定をしてるのはControllerじゃないので注意ね。

Template

/app/Plugin/Shiro8FreeShippingDisplay3/Resource/template/plg_shiro8_free_shipping.twig

ファイルを複製してリネームして中身を変更。

Event

/app/Plugin/Shiro8FreeShippingDisplay3/Shiro8FreeShippingDisplay3Event.php

$twig = $app->renderView(
    'Shiro8FreeShippingDisplay3/Resource/template/plg_shiro8_free_shipping.twig',
    array(
        'Cart' => $Cart,
        'least' => $least,
        'quantity' => $quantity,
        'is_delivery_free' => $isDeliveryFree,
    )
);

$search = '/<form id="shopping-form" method="post" /s';
$newHtml = $twig . '<form id="shopping-form" method="post" ';

最後らへんのこの部分を変更。
テンプレートファイル名を変更して、挿入部位を変更。

コメント

タイトルとURLをコピーしました