バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > 管理機能 > [Eigo] How to display product stocks in /admin/product page?

管理機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
allen28
投稿日時: 2018/7/26 16:10
対応状況: −−−
新米
登録日: 2018/7/26
居住地:
投稿: 2
[Eigo] How to display product stocks in /admin/product page?
Hi,

First of all I'm sorry for asking in English, I know that Eccube is a Japanese framework.

I just started using Eccube and I'm trying to display the # of Product Stocks in /admin/product page but it's not showing. The code that I use to display is {{ Product.class.stock }} Here's my code:


{% for Product in pagination %}
                                        <div id="result_list__item--{{ Product.id }}" class="item_box tr">
                                            <div id="result_list__id--{{ Product.id }}" class="item_id td">
                                                {{Product.id}}
                                            </div>
                                            <div id="result_list__image--{{ Product.id }}" class="item_photo td">
                                                <a href="{{ url('admin_product_product_edit', { id : Product.id }) }}">
                                                	<img src="{{ app.config.image_save_urlpath }}/{{ Product.mainFileName|no_image_product }}" />
                                                </a>
                                            </div>
                                            <div id="result_list__name--{{ Product.id }}" class="item_detail td">
                                                <a href="{{ url('admin_product_product_edit', { id : Product.id }) }}">
                                                    {{ Product.name }}
                                                </a><br>
                                                <span  id="result_list__code--{{ Product.id }}">

                                                    {{ Product.code_min }}
                                                    {% if Product.code_min != Product.code_max %}
                                                      ~ {{ Product.code_max }}
                                                      <br/>
                                                    {% endif %}
                                                    <span>Stocks:{{ Product.class.stock }}</span>

                                                </span>
                                            </div>
{% endfor %}



Thank you in advance for the help!
468
投稿日時: 2018/7/27 0:25
対応状況: −−−
登録日: 2008/10/26
居住地:
投稿: 3217
Re: [Eigo] How to display product stocks in /admin/product page?
Hi,

Methods for getting stocks are getStockMin() or getStockMax().

So twig code is
{{Product.stock_min}}
{{Product.stock_max}}


----------------
株式会社シロハチ
■ECCUBE2系、3系構築カスタマイズご相談ください。
EC-CUBE3マニュアル
blog

allen28
投稿日時: 2018/7/27 10:06
対応状況: −−−
新米
登録日: 2018/7/26
居住地:
投稿: 2
Re: [Eigo] How to display product stocks in /admin/product page?
Hello,

Thank you so much for the help! I tried to use the codes that you gave:
{{Product.stock_min}}
{{Product.stock_max}}

and it worked! However, in case I decided to add new columns in my Product table in the future.

For example: I would like to add imported_from field.
How can I make it display in the /admin/product page ?

Do you have a documentation for this? I can't find the documentation for {{Product.stock_min}} and {{Product.stock_max}} either on https://doc.ec-cube.net/


I'm sorry for the many questions.
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

総メンバー数は88,873名です
総投稿数は110,000件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1646
8
red
1570
9
mcontact
1295
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.