[EC-CUBE]モバイルでもポイント利用注文

モバイルでもポイントを利用した決済ができるようにします。

画面イメージ



まずはテンプレート。配達日時指定画面
/data/Smarty/templates/default/mobile/shopping/deliv_date.tpl
の33~35行目あたりを以下に変更。
  1. <!-- ▼mobileポイント利用 -->
  2. <!--{if $tpl_login == 1}-->
  3. ■ポイント利用<br />
  4. 現在の所持ポイントは「<font color="red"><!--{$tpl_user_point|default:0}--></font> pt」です。<br />
  5. 使用するポイントをご記入ください。ポイントを使用しない場合は「0」とご入力ください。<br />
  6. ※所持ポイント以上のポイントはご利用いただけません。<br />
  7. <input type="hidden" name="point_check" value="1" />
  8. <input type="text" name="use_point" istyle="4" />
  9. <!--{/if}-->
  10. <br/><br/>
  11. <!-- ▲mobileポイント利用 -->
  12.  


続いてご注文内容確認画面。
/data/Smarty/templates/default/mobile/shopping/confirm.tpl
の69行目あたりを編集。
※表現「商品合計」を「小計」に統一し、「円」を表示するようにしました。
  1. 小計:<!--{$tpl_total_pretax|number_format}-->(内消費税:<!--{$arrData.tax|number_format}-->)<br>
  2. 値引き(ポイントご使用時)<!--{assign var=discount value=`$arrData.use_point*$smarty.const.POINT_VALUE`}--><!--{$discount|number_format|default:0}--><br>
  3. 送料:<!--{$arrData.deliv_fee|number_format}--><br>
  4. <!--{if $arrData.charge > 0}-->手数料:<!--{$arrData.charge|number_format}--><br><!--{/if}-->
  5. 合計:<font color="red"><!--{$arrData.payment_total|number_format}--></font><br>
  6. <br>
  7.  
  8. 【ポイント】<br>
  9. ご注文前のポイント:<!--{$tpl_user_point|number_format|default:0}-->pt<br />
  10. ご使用ポイント:-<!--{$arrData.use_point|number_format|default:0}-->pt<br />
  11. <!--{if $arrData.birth_point > 0}-->
  12. お誕生月ポイント:+<!--{$arrData.birth_point|number_format|default:0}-->pt<br />
  13. <!--{/if}-->
  14. 今回加算されるポイント:+<!--{$arrData.add_point|number_format|default:0}-->pt<br />
  15. <!--{assign var=total_point value=`$tpl_user_point-$arrData.use_point+$arrData.add_point`}-->
  16. ご注文完了後のポイント:<!--{$total_point|number_format}-->pt<br />
  17.  


続いて、かご表示画面。
/data/Smarty/templates/default/mobile/cart/index.tpl
の63~68行目を以下の通り編集する。
※表現「商品合計」を「小計」に統一し、「円」を表示するようにしました。
  1. 小計:<!--{$tpl_total_pretax|number_format}--><br>
  2. 合計:<font color="red"><!--{$arrData.total-$arrData.deliv_fee|number_format}--></font><br>
  3. <!--{if $arrData.birth_point > 0}-->
  4. お誕生月ポイント:<!--{$arrData.birth_point|number_format}-->pt<br>
  5. <!--{/if}-->
  6. 今回加算ポイント:<!--{$arrData.add_point|number_format}-->pt<br>
  7.  

続いて、購入履歴詳細画面。
/data/Smarty/templates/default/mobile/mypage/history_detail.tpl
の56~58行目を以下の通り編集する。
※表現「商品合計」を「小計」に統一、「Pt」を「pt」に統一しました。
  1. 小計:<!--{$arrDisp.subtotal|number_format}--><br>
  2. <!-- 使用ポイントここから -->
  3. <!--{assign var=point_discount value="`$arrDisp.use_point*$smarty.const.POINT_VALUE`"}-->
  4. <!--{if $point_discount > 0}-->
  5. ポイント値引き:<!--{$point_discount|number_format}--><br>
  6. <!--{/if}-->
  7. <!--{assign var=key value="discount"}-->
  8. <!--{if $arrDisp[$key] != "" && $arrDisp[$key] > 0}-->
  9. 値引き:<!--{$arrDisp[$key]|number_format}--><br>
  10. <!--{/if}-->
  11. <!-- 使用ポイントここまで -->
  12.  
  13. 送料:<!--{assign var=key value="deliv_fee"}--><!--{$arrDisp[$key]|escape|number_format}--><br>
  14. 手数料:<!--{assign var=key value="charge"}--><!--{$arrDisp[$key]|escape|number_format}--><br>
  15. 合計:<font color="red"><!--{$arrDisp.payment_total|number_format}--></font><br>
  16. <br>
  17.  
  18. <!-- 使用ポイントここから -->
  19. ご使用ポイント:<!--{assign var=key value="use_point"}--><!--{$arrDisp[$key]|number_format|default:0}-->pt<br>
  20. 今回加算されるポイント:<!--{$arrDisp.add_point|number_format|default:0}-->pt<br>
  21. <!-- 使用ポイントここまで -->
  22.  

続いて、商品詳細画面。
/data/Smarty/templates/default/mobile/products/detail.tpl
の42~58目を以下の通り編集する。
  1. <!--★価格★-->
  2. 販売価格(税込):
  3. <font color="#FF0000">
  4. <!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
  5. <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
  6. <!--{else}-->
  7. <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--><!--{$arrProduct.price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
  8. <!--{/if}-->
  9. </font><br/>
  10. <!--{if $arrProduct.price01_max > 0}-->
  11. <font color="#FF0000">
  12. 通常価格:
  13. <!--{if $arrProduct.price01_min == $arrProduct.price01_max}-->
  14. <!--{$arrProduct.price01_min|number_format}-->
  15. <!--{else}-->
  16. <!--{$arrProduct.price01_min|number_format}--><!--{$arrProduct.price01_max|number_format}-->
  17. <!--{/if}-->
  18. </font><br>
  19. <!--{/if}-->
  20.  
  21. <!--★ポイント★-->
  22. <font color="#FF0000">
  23. ポイント:
  24. <!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
  25. <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->
  26. <!--{else}-->
  27. <!--{if $arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id == $arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->
  28. <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->
  29. <!--{else}-->
  30. <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->?<!--{$arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->
  31. <!--{/if}-->
  32. <!--{/if}-->pt</font><br/>
  33. <br/>
  34.  

これでモバイルでもポイントが利用できるようになる。
最終更新:2009年05月07日 15:21
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。