app/template/biotop/Product/option.twig line 1

Open in your IDE?
  1. {% if Product.ProductOptions %}
  2.     {% for ProductOption in Product.ProductOptions %}
  3.         {% set value = 'productoption' ~ ProductOption.Option.id %}
  4.         {# ラジオボタン #}
  5.         {% if ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::RADIO_TYPE') %}
  6.             <div class="ec-blockRadio plg_aoio" style="margin-top: 10px;">
  7.                 <div class="option_Label">
  8.                     <label for="productoption{{ ProductOption.Option.id }}">{{ form[value].vars.label }}</label>{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  9.                 </div>
  10.                 {{ form_widget(form[value]) }}
  11.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  12.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  13.                 {% endif %}
  14.             </div>
  15.             {# チェックボックス #}
  16.         {% elseif ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::CHECKBOX_TYPE')%}
  17.             <div class="ec-checkbox plg_aoio" style="margin-top: 10px;">
  18.                 <div class="option_Label">
  19.                     <label for="productoption{{ ProductOption.Option.id }}">{{ form[value].vars.label }}</label>{% if ProductOption.Option.require_min > 0 %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  20.                 </div>
  21.                 {{ form_widget(form[value]) }}
  22.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  23.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  24.                 {% endif %}
  25.             </div>
  26.             {# プルダウンタイプ #}
  27.         {% elseif  ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::SELECT_TYPE')%}
  28.             <div class="ec-select plg_aoio" style="margin-top: 10px;">
  29.                 <div class="option_Label">
  30.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  31.                 </div>
  32.                 <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  33.                     {{ form_widget(form[value]) }}
  34.                     {{ form_errors(form[value]) }}
  35.                 </div>
  36.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  37.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  38.                 {% endif %}
  39.             </div>
  40.             {# 数値入力タイプ #}
  41.         {% elseif ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::NUMBER_TYPE') %}
  42.             <div class="ec-numberInput plg_aoio" style="margin-top: 10px;">
  43.                 <div class="option_Label">
  44.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  45.                 </div>
  46.                 <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  47.                     {{ form_widget(form[value]) }}
  48.                     {{ form_errors(form[value]) }}
  49.                 </div>
  50.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  51.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  52.                 {% endif %}
  53.             </div>
  54.             {# 日付タイプ #}
  55.         {% elseif ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DATE_TYPE') %}
  56.             <div class="ec-input plg_aoio" style="margin-top: 10px;">
  57.                 <div class="option_Label">
  58.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  59.                 </div>
  60.                 <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %} style="position: relative">
  61.                     {{ form_widget(form[value], { attr : { 'data-target' : '#'~form[value].vars.id }}) }}
  62.                     {{ form_errors(form[value]) }}
  63.                 </div>
  64.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  65.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  66.                 {% endif %}
  67.             </div>
  68.             {# テキストボックスタイプ #}
  69.         {% elseif ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::TEXT_TYPE') %}
  70.             <div class="ec-input plg_aoio" style="margin-top: 10px;">
  71.                 <div class="option_Label">
  72.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  73.                 </div>
  74.                 <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  75.                     {{ form_widget(form[value]) }}
  76.                     {{ form_errors(form[value]) }}
  77.                 </div>
  78.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  79.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  80.                 {% endif %}
  81.             </div>
  82.             {# テキストエリアタイプ #}
  83.         {% elseif ProductOption.Option.type == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::TEXTAREA_TYPE')%}
  84.             <div class="ec-input plg_aoio" style="margin-top: 10px;">
  85.                 <div class="option_Label">
  86.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  87.                 </div>
  88.                 <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  89.                     {{ form_widget(form[value]) }}
  90.                     {{ form_errors(form[value]) }}
  91.                 </div>
  92.                 {% if ProductOption.Option.description_flg == constant('Plugin\\ApexOrderItemOption\\Entity\\Option::DISP_ON') %}
  93.                     <p>{{ ProductOption.Option.description|nl2br }}</p>
  94.                 {% endif %}
  95.             </div>
  96.         {% endif %}
  97.     {% endfor %}
  98. {% endif %}