バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > その他 > 商品詳細ページでの規格情報表示

その他

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
468
投稿日時: 2019/3/19 14:23
対応状況: −−−
登録日: 2008/10/26
居住地:
投稿: 3217
Re: 商品詳細ページでの規格情報表示
規格商品関連のデータ構造として、商品(Product)に対して複数の規格商品(ProductClass)が紐づいています。

商品から紐づいた規格商品を取得するには、
ProductエンティティのgetProductClasses()を利用する事になります。

管理画面>商品編集ページで規格商品の一覧を表示している箇所がありますが、
twigには以下のように記述されています。
<table class="table table-striped">
    <thead class="table-active">
    <th class="pl-3 pt-2 pb-2">{{ 'admin.product.class_category1__short'|trans }}</th>
    <th class="pt-2 pb-2">{{ 'admin.product.class_category2__short'|trans }}</th>
    <th class="pt-2 pb-2">{{ 'admin.product.product_code__short'|trans }}</th>
    <th class="pt-2 pb-2">{{ 'admin.product.stock'|trans }}</th>
    <th class="pr-3 pt-2 pb-2">{{ 'admin.product.price'|trans }}</th>
    </thead>
    <tbody>
    {% for Class in Product.ProductClasses %}
        {% if Class.visible == 1 %}
            <tr>
                <td class="pl-3">{% if Class.hasClassCategory1 %}{{ Class.ClassCategory1.name }}{% endif %}</td>
                <td>{% if Class.hasClassCategory2 %}{{ Class.ClassCategory2.name }}{% endif %}</td>
                <td>{{ Class.code }}</td>
                <td>{% if Class.stock_unlimited %}{{ 'admin.product.stock_unlimited__short'|trans }}{% else %}{{ Class.stock }}{% endif %}</td>
                <td class="pr-3">{{ Class.price02|price }}</td>
            </tr>
        {% endif %}
    {% endfor %}
    </tbody>
</table>

多少記述を変える必要はあると思いますが(表題など)、
{% for Class in Product.ProductClasses %}
{% endfor %}
の付近の記述は参考になるのではないでしょうか?


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

フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   商品詳細ページでの規格情報表示 coppola 2019/3/18 19:14
     Re: 商品詳細ページでの規格情報表示 468 2019/3/18 21:13
       Re: 商品詳細ページでの規格情報表示 coppola 2019/3/19 10:21
       » Re: 商品詳細ページでの規格情報表示 468 2019/3/19 14:23
           Re: 商品詳細ページでの規格情報表示 coppola 2019/3/19 15:03

 



ログイン


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

統計情報

総メンバー数は89,136名です
総投稿数は110,040件です

投稿数ランキング

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