###前提・実現したいこと
smartyを使ってecサイトを制作しているのですが、
DBに登録されている税別価格をsmatyで読み込み、
それにphpを使って1.08を掛けて税込価格を表示したいです。
###発生している問題・エラーメッセージ
###該当のソースコード
<span class="price">
<!--{if $arrProducts[cnt].price02_min == $arrProducts[cnt].price02_max}--> <!--{$arrProducts[cnt].price02_min|reduce_price:$arrProducts[cnt].product_id:$smarty.session.customer.customer_id|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{else}--> <!--{$arrProducts[cnt].price02_min|reduce_price:$arrProducts[cnt].product_id:$smarty.session.customer.customer_id|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~ <!--{$arrProducts[cnt].price02_max|reduce_price:$arrProducts[cnt].product_id:$smarty.session.customer.customer_id|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{/if}--> 円</span><span class="mini">(税込)</span></span>
###試したこと
上記のif文で、金額を読み込んでいると思うので、
ここで読み込んだ変数をphpに受け渡せればと思ったのですが、
良い方法が見つかりませんでした。
<!--{/php}-->echo "テンプレ内PHP出力テスト";
を使ってphpが動作することは確認済みです。
###補足情報(言語/FW/ツール等のバージョンなど)
smartyもphpも初学者の為、
前提から理解していないかもしれませんが、
どうぞよろしくお願い致します。
回答2件
あなたの回答
tips
プレビュー