-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OP-289: Add accordion with bundled products on order view
- Loading branch information
Showing
2 changed files
with
43 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 36 additions & 29 deletions
65
src/Resources/views/Admin/Order/Show/_productBundleOrderItems.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,42 @@ | ||
<h3>{{ 'bitbag_sylius_product_bundle.ui.products_in_bundle'|trans }}</h3> | ||
|
||
{% for item in items %} | ||
{% set variant = item.productVariant %} | ||
{% set product = variant.product %} | ||
<div class="ui accordion"> | ||
<div class="title"> | ||
<i class="dropdown icon"></i> <strong>{{ 'bitbag_sylius_product_bundle.ui.products_in_bundle'|trans }}</strong> | ||
</div> | ||
|
||
<div class="ui segment"> | ||
<div class="ui header"> | ||
{% include '@SyliusAdmin/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_admin_product_tiny_thumbnail'} %} | ||
<div class="content"> | ||
<div class="sylius-product-name" title="{{ product.name }}">{{ product.name }}</div> | ||
<span class="sub header sylius-product-variant-code" title="{{ variant.code }}"> | ||
{{ variant.code }} | ||
</span> | ||
</div> | ||
</div> | ||
{% if product.hasOptions() %} | ||
<div class="ui horizontal divided list sylius-product-options"> | ||
{% for optionValue in variant.optionValues %} | ||
<div class="item" data-sylius-option-name="{{ optionValue.name }}"> | ||
{{ optionValue.value }} | ||
<div class="content"> | ||
{% for item in items %} | ||
{% set variant = item.productVariant %} | ||
{% set product = variant.product %} | ||
|
||
<div class="ui segment"> | ||
<div class="ui header"> | ||
{% include '@SyliusAdmin/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_admin_product_tiny_thumbnail'} %} | ||
<div class="content"> | ||
<div class="sylius-product-name" title="{{ product.name }}">{{ product.name }}</div> | ||
<span class="sub header sylius-product-variant-code" title="{{ variant.code }}"> | ||
{{ variant.code }} | ||
</span> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% elseif variant.name is not null %} | ||
<div class="ui horizontal divided list"> | ||
<div class="item sylius-product-variant-name"> | ||
{{ variant.name }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if product.hasOptions() %} | ||
<div class="ui horizontal divided list sylius-product-options"> | ||
{% for optionValue in variant.optionValues %} | ||
<div class="item" data-sylius-option-name="{{ optionValue.name }}"> | ||
{{ optionValue.value }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% elseif variant.name is not null %} | ||
<div class="ui horizontal divided list"> | ||
<div class="item sylius-product-variant-name"> | ||
{{ variant.name }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
<p>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}: {{ item.quantity }}</p> | ||
<p>{{ 'bitbag_sylius_product_bundle.ui.quantity'|trans }}: {{ item.quantity }}</p> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
</div> |