なんちゃって「WEB担当者」の備忘録いろいろ

「WEB担当者」になりきれないOLが毎日奮闘しています。

*

加算ポイントの計算を、ポイント値引き・クーポン値引き後の金額に対して行う方法(ご注文確認画面 表示だけ)

      2020/01/28

加算ポイントの計算を、ポイント値引き・クーポン値引き後の金額に対して行う方法
(ご注文確認画面 表示だけ)

 

注文確認画面で「今回加算ポイント」がクーポン利用前の金額に対しての計算だったので

計算式を変更

 

shop/data/Samarty/templates_c/bootstrap3/%%3D^3DB^3DBE305D%%confirm.tpl.php

の186行目
「今回加算予定のポイント」

【ここから】
<div class=”col-xs-4 text-right”>
+<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars[‘arrForm’][‘add_point’])) ? $this->_run_mod_handler(‘script_escape’, true, $_tmp) :
smarty_modifier_script_escape($_tmp)))) ? $this->_run_mod_handler(‘number_format’, true, $_tmp) : number_format($_tmp)))) ? $this->_run_mod_handler(‘default’, true, $_tmp, 0) :
smarty_modifier_default($_tmp, 0)); ?>
Pt

【ここまで】


【ここから】

+<?php $this->assign(‘add_point’, ($this->_tpl_vars[‘arrForm’][‘payment_total’] * 0.0003336)); ?>
<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars[‘add_point’])) ? $this->_run_mod_handler(‘script_escape’, true, $_tmp) : smarty_modifier_script_escape($_tmp)))) ? $this->_run_mod_handler(‘number_format’, true, $_tmp) : number_format($_tmp)))) ? $this->_run_mod_handler(‘default’, true, $_tmp, 0) : smarty_modifier_default($_tmp, 0)); ?>
Pt</strong>

【ここまで】

に変更

計算式を支払い合計金額×ポイント付与率(赤字  * 0.0003336)へ変更しただけ。
私はポイント付与率を変更する予定がまったくないので数値を入力しましたが、
変更する可能性があるのであれば代入できるようにしているほうが無難だと思います。

お客様側の注文履歴画面、注文確認メールに記載されている加算予定ポイントが
クーポン利用前の金額に対してのポイント数になっちゃってるので
根本的に add_pointの数値をデータベースに渡す前に変更する方法が必要なのか?

 - EC-cube ,