teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

内容ご確認いただきありがとうございます。またECCUBE側で実行される内容を追記いたしました。

2021/11/22 12:07

投稿

eric_1225
eric_1225

スコア3

title CHANGED
File without changes
body CHANGED
@@ -68,6 +68,7 @@
68
68
 
69
69
  ```twig
70
70
  ##ECCUBE側で実行されるコード
71
+ {% if pagination.totalItemCount > 0 %}
71
72
  <div class="ec-shelfRole">
72
73
  <ul class="ec-shelfGrid">
73
74
  {% for Product in pagination %}
@@ -132,6 +133,7 @@
132
133
  {% endfor %}
133
134
  </ul>
134
135
  </div>
136
+ {% endif %}
135
137
  ```
136
138
 
137
139
 

1

内容ご確認いただきありがとうございます。またECCUBE側で実行される内容を追記いたしました。

2021/11/22 12:07

投稿

eric_1225
eric_1225

スコア3

title CHANGED
File without changes
body CHANGED
@@ -66,6 +66,75 @@
66
66
  });
67
67
  ```
68
68
 
69
+ ```twig
70
+ ##ECCUBE側で実行されるコード
71
+ <div class="ec-shelfRole">
72
+ <ul class="ec-shelfGrid">
73
+ {% for Product in pagination %}
74
+ <li class="ec-shelfGrid__item">
75
+ <a href="{{ url('product_detail', {'id': Product.id}) }}" class="ec-shelfGrid__item-url">
76
+ <p class="ec-shelfGrid__item-image">
77
+ <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" loading="lazy">
78
+ </p>
79
+ <p class="ec-shelfGrid__item-title">{{ Product.name }}</p>
80
+ {% if Product.description_list %}
81
+ <p class="ec-shelfGrid__item-title">{{ Product.description_list|raw|nl2br }}</p>
82
+ {% endif %}
83
+ <p class="price02-default">
84
+ {% if Product.hasProductClass %}
85
+ {% if Product.getPrice02Min == Product.getPrice02Max %}
86
+ {{ Product.getPrice02IncTaxMin|price }}
87
+ {% else %}
88
+ {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
89
+ {% endif %}
90
+ {% else %}
91
+ {{ Product.getPrice02IncTaxMin|price }}
92
+ {% endif %}
93
+ </p>
94
+ </a>
95
+
96
+ {% if Product.stock_find %}
97
+ {% set form = forms[Product.id] %}
98
+ <form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_add_cart', {id:Product.id}) }}" method="post">
99
+ <div class="ec-productRole__actions">
100
+ {% if form.classcategory_id1 is defined %}
101
+ <div class="ec-select">
102
+ {{ form_widget(form.classcategory_id1) }}
103
+ {{ form_errors(form.classcategory_id1) }}
104
+ </div>
105
+ {% if form.classcategory_id2 is defined %}
106
+ <div class="ec-select">
107
+ {{ form_widget(form.classcategory_id2) }}
108
+ {{ form_errors(form.classcategory_id2) }}
109
+ </div>
110
+ {% endif %}
111
+ {% endif %}
112
+ <div class="ec-numberInput"><span>{{ '数量'|trans }}</span>
113
+ {{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
114
+ {{ form_errors(form.quantity) }}
115
+ </div>
116
+ </div>
117
+ {{ form_rest(form) }}
118
+ </form>
119
+ <div class="ec-productRole__btn">
120
+ <button type="submit" class="ec-blockBtn--action add-cart" data-cartid="{{ Product.id }}" form="productForm{{ Product.id }}">
121
+ {{ 'カートに入れる'|trans }}
122
+ </button>
123
+ </div>
124
+ {% else %}
125
+ <div class="ec-productRole__btn">
126
+ <button type="button" class="ec-blockBtn--action" disabled="disabled">
127
+ {{ 'ただいま品切れ中です。'|trans }}
128
+ </button>
129
+ </div>
130
+ {% endif %}
131
+ </li>
132
+ {% endfor %}
133
+ </ul>
134
+ </div>
135
+ ```
136
+
137
+
69
138
  下がwordpressの現在の状態の画像です
70
139
  ![現在のwordpressの状態](4b52f742c3f6c6733fd5cb2cd3a5bc77.jpeg)
71
140