Skip to content

Commit dddd239

Browse files
committed
OP-289: Add accordion with bundled products on order view
1 parent 2ec8439 commit dddd239

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/Resources/views/Admin/Order/Show/Summary/_item.html.twig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<tr>
1818
<td class="single line">
1919
{% include '@SyliusAdmin/Product/_info.html.twig' %}
20-
21-
{{ bitbag_render_product_bundle_order_items(item) }}
2220
</td>
2321
<td class="right aligned unit-price">
2422
{{ money.format(item.unitPrice, order.currencyCode) }}
@@ -50,3 +48,10 @@
5048
{{ money.format(item.total, order.currencyCode) }}
5149
</td>
5250
</tr>
51+
{% if product.bundle %}
52+
<tr>
53+
<td colspan="9">
54+
{{ bitbag_render_product_bundle_order_items(item) }}
55+
</td>
56+
</tr>
57+
{% endif %}

src/Resources/views/Admin/Order/Show/_productBundleOrderItems.html.twig

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
<h3>{{ 'bitbag_sylius_product_bundle.ui.products_in_bundle'|trans }}</h3>
21

3-
{% for item in items %}
4-
{% set variant = item.productVariant %}
5-
{% set product = variant.product %}
2+
<div class="ui accordion">
3+
<div class="title">
4+
<i class="dropdown icon"></i> <strong>{{ 'bitbag_sylius_product_bundle.ui.products_in_bundle'|trans }}</strong>
5+
</div>
6+
7+
<div class="content">
8+
{% for item in items %}
9+
{% set variant = item.productVariant %}
10+
{% set product = variant.product %}
611

712
<div class="ui segment">
813
<div class="ui header">
@@ -30,6 +35,8 @@
3035
</div>
3136
{% endif %}
3237

33-
<p>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}: {{ item.quantity }}</p>
38+
<p>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}: {{ item.quantity }}</p>
39+
</div>
40+
{% endfor %}
3441
</div>
35-
{% endfor %}
42+
</div>

0 commit comments

Comments
 (0)