Skip to content

Commit

Permalink
Merge pull request #1078 from EC-CUBE/seasoft-no_sfMultiply
Browse files Browse the repository at this point in the history
テンプレートの上の乗算を直感的に。sfMultiply ではなく演算子で行う。
  • Loading branch information
seasoftjapan authored Dec 16, 2024
2 parents c2247d0 + 0dd5f76 commit f036a53
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/Smarty/templates/admin/order/disp.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<!--{assign var=tax_rate value="`$arrForm.tax_rate.value[$product_index]`"}-->
<!--{assign var=tax_rule value="`$arrForm.tax_rule.value[$product_index]`"}-->
<td class="right"><!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|n2s}--> 円<br />(税率<!--{$tax_rate|n2s}-->%)</td>
<td class="right"><!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|sfMultiply:$quantity|n2s}-->円</td>
<td class="right"><!--{($price|sfCalcIncTax:$tax_rate:$tax_rule*$quantity)|n2s}-->円</td>
</tr>
<!--{/section}-->
<tr>
Expand Down
2 changes: 1 addition & 1 deletion data/Smarty/templates/admin/order/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
<span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
税率<input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />%
</td>
<td class="right"><!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|sfMultiply:$quantity|n2s}--></td>
<td class="right"><!--{($price|sfCalcIncTax:$tax_rate:$tax_rule*$quantity)|n2s}--></td>
</tr>
<!--{/section}-->
<tr>
Expand Down
2 changes: 1 addition & 1 deletion data/Smarty/templates/default/mypage/history.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<!--{/if}-->
</td>
<td class="alignR"><!--{$orderDetail.quantity|h}--></td>
<td class="alignR"><!--{$orderDetail.price_inctax|sfMultiply:$orderDetail.quantity|n2s}-->円</td>
<td class="alignR"><!--{($orderDetail.price_inctax*$orderDetail.quantity)|n2s}-->円</td>
</tr>
<!--{/foreach}-->
<tr>
Expand Down
2 changes: 1 addition & 1 deletion data/Smarty/templates/mobile/mypage/history.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!--{assign var=tax_rule value="`$orderDetail.tax_rule`"}-->
<!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|n2s|h}-->円<br>
数量:<!--{$quantity|h}--><br>
小計:<!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|sfMultiply:$quantity|n2s}-->円<br>
小計:<!--{($price|sfCalcIncTax:$tax_rate:$tax_rule*$quantity)|n2s}-->円<br>
<!--{/foreach}-->
<hr>
小計:<!--{$tpl_arrOrderData.subtotal|n2s}-->円<br>
Expand Down
2 changes: 1 addition & 1 deletion data/Smarty/templates/sphone/mypage/history.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<!--{assign var=tax_rule value="`$orderDetail.tax_rule`"}-->
<ul>
<li><span class="mini">数量:</span><!--{$quantity|h}--></li>
<li class="result"><span class="mini">小計:</span><!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|sfMultiply:$quantity|n2s}-->円</li>
<li class="result"><span class="mini">小計:</span><!--{($price|sfCalcIncTax:$tax_rate:$tax_rule*$quantity)|n2s}-->円</li>
</ul>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion data/class/util/SC_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,11 @@ public static function getHash2Array($hash, $requires = [])
return $array;
}

/* かけ算をする(Smarty用) */
/**
* かけ算をする(Smarty用)
*
* @deprecated 本体で使用されていないため非推奨
*/
public static function sfMultiply($num1, $num2)
{
return $num1 * $num2;
Expand Down

0 comments on commit f036a53

Please sign in to comment.