vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_variants.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. <table class="ui single line small table" id="sylius-product-variants" {{ sylius_test_html_attribute('product-variants') }}>
  3.     <thead>
  4.     <tr>
  5.         <th>{{ 'sylius.ui.variant'|trans }}</th>
  6.         <th>{{ 'sylius.ui.price'|trans }}</th>
  7.         <th></th>
  8.     </tr>
  9.     </thead>
  10.     <tbody>
  11.     {% for key, variant in product.enabledVariants %}
  12.         <tr {{ sylius_test_html_attribute('product-variants-row') }}>
  13.             <td>
  14.                 {{ variant.name }}
  15.                 {% if product.hasOptions() %}
  16.                     <div class="ui horizontal divided list">
  17.                         {% for optionValue in variant.optionValues %}
  18.                             <div class="item">
  19.                                 {{ optionValue.value }}
  20.                             </div>
  21.                         {% endfor %}
  22.                     </div>
  23.                 {% endif %}
  24.             </td>
  25.             <td class="sylius-product-variant-price" {% if variant|sylius_has_discount({'channel': sylius.channel}) %}data-original-price="{{ money.calculateOriginalPrice(variant) }}"{% endif %}>
  26.                 {{ money.calculatePrice(variant) }}
  27.             </td>
  28.             <td class="right aligned">
  29.                 {{ form_widget(form.cartItem.variant[key], {'label': false}) }}
  30.             </td>
  31.         </tr>
  32.     {% endfor %}
  33.     </tbody>
  34. </table>