Skip to content

Commit

Permalink
OP-550 - Change twig paths
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPalen committed Dec 16, 2024
1 parent 8e9decc commit 702918a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/Resources/config/twig_hooks/order/show.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ sylius_twig_hooks:
hooks:
'sylius_admin.order.show.content.sections.items.body':
item:
template: '@SyliusAdmin/Order/Show/Summary/_item.html.twig'
template: '@SyliusAdmin/order/show/content/sections/items/body/item.html.twig'
priority: 800
6 changes: 6 additions & 0 deletions src/Resources/config/twig_hooks/product/shop/show.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sylius_twig_hooks:
hooks:
'sylius_shop.product.show.content.info.summary.add_to_cart':
bundle:
template: "@BitBagSyliusProductBundlePlugin/Shop/product/show/page/info/summary/add_to_cart/addProductBundleToCart.html.twig"
priority: 20
40 changes: 0 additions & 40 deletions src/Resources/views/Shop/Product/_addProductBundleToCart.html.twig

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#{% if hookable_metadata.context.resource is defined %}#}
{{ dump() }}
{% set product = hookable_metadata.context.resource %}
{% if product.isBundle %}
{% set form = hookable_metadata.context.form %}
{% set configuration = hookable_metadata.context.configuration %}
{% set product_bundle_items = form.productBundleItems %}

{% form_theme form '@SyliusShop/Form/theme.html.twig' %}

<div id="sylius-product-selecting-variant">
<h4 class="mt-4">{{ 'bitbag_sylius_product_bundle.ui.products_in_bundle'|trans }}</h4>
{% for item in product_bundle_items %}
{% set data = item.vars.data %}
<div class="card">
<div class="card-body">
<strong>
{{ data.quantity }} x {{ data.productVariant.product.name }}
</strong>
{% if item.productVariant is defined %}
{{ form_row(item.productVariant) }}
{% endif %}
</div>
</div>
{% endfor %}
</div>
<div class="mb-3"></div>
{% endif %}
{#{% endif %}#}

0 comments on commit 702918a

Please sign in to comment.