バージョン選択

フォーラム

メニュー

オンライン状況

31 人のユーザが現在オンラインです。 (26 人のユーザが フォーラム を参照しています。)
登録ユーザ: 1
ゲスト: 30
chako79 もっと...

サイト内検索

 > プラグイン > 金額の表示に関して

プラグイン

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
yoshisan
投稿日時: 2016/6/20 1:15
対応状況: −−−
常連
登録日: 2016/4/11
居住地:
投稿: 52
金額の表示に関して
現在、下記2つのプラグインを使用しているのですが、


■売り上げランキングプラグイン
https://www.ec-cube.net/products/detail.php?product_id=1034

表示された金額に「,(コンマ)」が入っている。
例)5,500円




■新商品表示ブロック追加(3.0系)
https://www.ec-cube.net/products/detail.php?product_id=997

表示された金額に「,(コンマ)」が入っていない。
例)5500円




希望としては、「売り上げランキングプラグイン」のように「,(コンマ)」が入るようにしたいです。



下記、両方のソースです。
どこか修正したら同じ表示になりますでしょうか?


-------

■売り上げランキングプラグイン


{% if ItemList %}

<div id="sales_ranking" class="item_gallery">
<h2 class="heading01 top_content_title">人気ランキング</h2>
<div class="row">
{% for Item in ItemList %}
<div class="col-sm-3 col-xs-6">
<div class="pickup_item">
<a href="{{ url('product_detail', {'id': Item.id}) }}">
<div class="item_photo"><img src="{{ app.config.image_save_urlpath }}/{{ Item.main_list_image|no_image_product }}"></div>
<dl>
<dt class="item_name"><span class="label-warning">{{loop.index}}位</span><br />{{Item.name}}</dt>
<dd class="item_price">
{% if Item.hasProductClass -%}
{% if Item.getPrice02Min == Item.getPrice02Max %}
<p class="normal_price"><span class="price01_default">{{ Item.getPrice02IncTaxMin|number_format }}</span><span class="small">円</span></p>
{% elseif Item.getPrice02Min is not null and Item.getPrice02Max is not null %}
<p class="normal_price"><span class="price01_default">{{ Item.getPrice02IncTaxMin|number_format }}<span class="small">円</span></span> 〜 <span class="price01_default">{{ Item.getPrice02IncTaxMax|number_format }}<span class="small">円</span></span></p>
{% endif %}
{% else -%}
{% if Item.getPrice02Max is not null %}
<p class="normal_price"><span class="price01_default">{{ Item.getPrice02IncTaxMin|number_format }}<span class="small">円</span></span></p>
{% endif %}
{% endif -%}
</dd>
</dl>
</a>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}





-------

■新商品表示ブロック追加(3.0系)


{% if newItemList %}
<div id="contents_top">
<h2 class="top_content_title">{{ newItemInfo.newitem_title }}</h2>
<ul class="row">
{% for newItem in newItemList %}
<div class="col-sm-{{ newItemInfo.newitem_column_pc }} col-xs-{{ newItemInfo.newitem_column_sp }}">
<div class="pickup_item">
<a href="{{ url('product_detail', {'id': newItem.id}) }}">
<div class="item_photo"><img src="{{ app.config.image_save_urlpath }}/{{ newItem.main_list_image|no_image_product }}"></div>
<dl>
{% if newItemInfo.newitem_disp_title == 0 %}
<dt class="item_name text-warning">{{newItem.name}}</dt>
{% endif %}

{% if newItemInfo.newitem_disp_price == 0 %}
<dd class="item_price">
{% if newItem.hasProductClass %}
{% if newItem.getPrice02Min == newItem.getPrice02Max %}
{{ newItem.getPrice02IncTaxMin }}<span class="small">円</span>
{% elseif newItem.getPrice02Min is not null and newItem.getPrice02Max is not null %}
{{ newItem.getPrice02IncTaxMin }} 〜 {{ newItem.getPrice02IncTaxMax }}<span class="small">円</span>
{% endif %}
</dd>
{% else %}
{% if newItem.getPrice02Max is not null %}
{{ newItem.getPrice02IncTaxMin }}<span class="small">円</span>
{% endif %}
</dd>
{% endif %}
{% endif %}

{% if newItemInfo.newitem_disp_id == 0 %}
<dt class="item_name">商品コード: <span id="item_code_default">
{{ newItem.code_min }}
{% if newItem.code_min != newItem.code_max %} 〜 {{ newItem.code_max }}{% endif %}
</span> </dt>
{% endif %}

{% if newItemInfo.newitem_disp_description == 0 %}
<dd class="item_comment">{{ newItem.description_detail[:50] ~ '...' |raw|nl2br }}</dd>
{% endif %}

</a>

{% if newItemInfo.newitem_disp_cat == 0 %}
<div class="relative_cat">
<dd>関連カテゴリ</dd>
{% for ProductCategory in newItem.ProductCategories %}
<ol>
{% for Category in ProductCategory.Category.path %}
<li><a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a></li>
{% endfor %}
</ol>
{% endfor %}
</div>
{% endif %}
</dl>
</div>
</div>
{% endfor %}
</ul>
</div>
{% endif -%}





ご教授の程よろしくお願い致します。

nyorai
投稿日時: 2016/6/20 9:29
対応状況: −−−
仙人
登録日: 2015/8/21
居住地:
投稿: 302
Re: 金額の表示に関して
「number_format」で、カンマ区切りの整形を行っています。


{{ newItem.getPrice02IncTaxMin|number_format }}


のように適用させることができるので、カンマ区切りにしたい箇所に埋め込んで行くと良いかと思います。
yoshisan
投稿日時: 2016/6/20 19:00
対応状況: 解決済
常連
登録日: 2016/4/11
居住地:
投稿: 52
Re: 金額の表示に関して
nyorai様

ありがとうございます

{{ newItem.getPrice02IncTaxMin }}<span class="small">円</span>


から


{{ newItem.getPrice02IncTaxMin|number_format }}<span class="small">円</span>


に、直したらカンマ区切りで表示されました!

ありがとうございます!
助かりました!!!
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,728名です
総投稿数は109,953件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1638
8
red
1570
9
mcontact
1286
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.