Skip to content

Commit

Permalink
CORE-3744: fix ProductOptionsWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmente committed Mar 28, 2018
1 parent 9ac6f33 commit ad30e6f
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public static function getName(): string
*/
public static function getTemplate(): string
{
return '@ProductOptionWidget/_cart-page/cart-item-product-options.twig';
return '@ProductOptionWidget/views/option-display/option-display.twig';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function getName(): string
*/
public static function getTemplate(): string
{
return '@ProductOptionWidget/_product-detail-page/product-options.twig';
return '@ProductOptionWidget/views/option-configurator/option-configurator.twig';
}

/**
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends template('widget') %}

{% define data = {
optionGroups: _widget.productOptionGroups
} %}

{% block template %}
{% if data.optionGroups is not empty %}{{parent()}}{% endif %}
{% endblock %}

{% block body %}
<ul class="list list--spacing">
{% for optionGroup in data.optionGroups %}
<li class="list__item">
<strong>{{optionGroup.name | trans}}</strong>
{% embed atom('select') with {
modifiers: ['expand'],
attributes: {
name: 'product-option[' ~ optionGroup.name ~ ']',
},
embed: {
options: optionGroup.productOptionValues
}
} only %}
{% block options %}
<option value="0">{{ 'product.product_options_select' | trans }}</option>
{% for option in embed.options %}
<option value="{{option.idProductOptionValue}}">{{ option.value | trans }} {{ option.price | money }}</option>
{% endfor %}
{% endblock %}
{% endembed %}
</li>
{% endfor %}
</ul>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends template('widget') %}

{% define data = {
options: _widget.cartItem.productOptions
} %}

{% block template %}
{% if data.options is not empty %}{{parent()}}{% endif %}
{% endblock %}

{% block body %}
<ul class="list list--expand">
{% for option in data.options %}
<li class="list__item">
+ {{ option.value | trans }}
<span class="float-right">{{ option.unitPrice | money }}</span>
</li>
{% endfor %}
</ul>
{% endblock %}

0 comments on commit ad30e6f

Please sign in to comment.