{#* Plugin Name : ProductOption** Copyright (C) BraTech Co., Ltd. All Rights Reserved.* http://www.bratech.co.jp/** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.#}{% set prev_condition = '' %}{% set count = 0 %}{% set index = 0 %}{% for ProductOption in ProductOptions %} {% set Option = ProductOption.Option %} {% set Product = ProductOption.Product %} {% set value = 'productoption' ~ ProductOption.Option.id %} {% set current_condition = '' %} {% if '張地' in ProductOption.Option.backend_name %} {% set current_condition = '張地' %} {% elseif 'サイズ選択' in ProductOption.Option.backend_name %} {% set current_condition = 'サイズ' %} {% elseif '画像あり' in ProductOption.Option.backend_name %} {% set current_condition = '画像あり' %} {% elseif '配送' in ProductOption.Option.backend_name %} {% set current_condition = '配送' %} {% else %} {# 他の条件を追加する場合は、ここに追加してください。 #} {% endif %} {% if (prev_condition != current_condition and current_condition == '張地') or (prev_condition != current_condition and current_condition == 'サイズ') %} {# 最後のカウントの処理 ============================= #} {% if prev_condition != '' %} {% endif %} {# 最初のカウントの処理 ============================= #} {% set count = 0 %} {% if count == 0 %} <div id="option_description_{{ current_condition }}" class="option_description"> <div class="modal-header"> <div class="plainmodal-close">×</div> <h4 class="modal-title">{{ current_condition }}選択</h4> </div> <div class="modal-body"> {% for ProductOption in Product.ProductOptions %} {% set value = 'productoption' ~ ProductOption.Option.id %} {% if current_condition in ProductOption.Option.backend_name %} <div class="option_Label"> {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %} <p>{{ ProductOption.Option.description|raw|nl2br }}</p> </div> <div class="opcion_first_flex"> {% for optionCategory in ProductOption.option.OptionCategories %} {% if optionCategory.disable_flg != constant('Plugin\\ProductOption42\\Entity\\OptionCategory::ON') %} <div class="opcion_first_flex__block"> {% for OptionImage in optionCategory.OptionImages %} <img src="{{ asset(OptionImage, 'save_image') }}"/> {% endfor %} <span class="option_txt">{{ optionCategory.name }}</span> </div> {% endif %} {% endfor %} </div> {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %} <a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}" class="option_description_link_second"><span class="ec-link ec-font-size-2">{{ form_label(form[value]) }}から選択する</span></a> {% endif %} {% endif %} {% endfor %} </div> </div> {% endif %} {% endif %} {# 最初と最後以外の通常処理 ============================= #} <div id="option_description_{{ Product.id }}_{{ Option.id }}" class="option_description option_description__detail"> <div class="modal-header"> <div class="plainmodal-close">×</div> <h4 class="modal-title">{{ Option.name }}</h4> <p>{{ Option.description|raw|nl2br }}</p> {% if current_condition == '張地' or current_condition == 'サイズ' %} <a href="?" id="option_back_link_{{ current_condition }}" class="option_back_btn" data="{{ Product.id }}"> <span class="ec-link ec-font-size-2">< 一覧に戻る</span> </a> {% endif %} </div> {% if Option.OptionCategories|length > 0%} {# テキストボックス、テキストエリア、日付、数値入力タイプの場合 #} {% if Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::TEXT_TYPE') or Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::TEXTAREA_TYPE') or Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::NUMBER_TYPE') or Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::DATE_TYPE') %} <div class="modal-body"> {% set optionCategory = Option.OptionCategories[0] %} <div> {% for OptionImage in optionCategory.OptionImages %} <img src="{{ asset(OptionImage, 'save_image') }}"/> {% endfor %} {% if optionCategory.value|length > 0 %} {% if optionCategory.value > 0 %} <p class="plus">{{'productoption.product.option.description.price'|trans}}:{{ priceIncTax(optionCategory.value, Product)|price }} <span class="small">{{'productoption.product.option.description.inc_tax'|trans}}</span></p> {% elseif optionCategory.value < 0 %} <p class="minus">{{'productoption.product.option.description.price'|trans}}:{{ priceIncTax(optionCategory.value, Product)|price }} <span class="small">{{'productoption.product.option.description.inc_tax'|trans}}</span></p> {% endif %} {% endif %} {% if optionCategory.delivery_free_flg == constant('Plugin\\ProductOption42\\Entity\\OptionCategory::ON') %} <p>{{'productoption.common.delivery_free'|trans}}</p> {% endif %} </div> </div> {# プルダウン、ラジオボタン、チェックボックスタイプの場合 #} {% else %} <div class="modal-body"> {% for optionCategory in Option.OptionCategories %} {% if optionCategory.disable_flg != constant('Plugin\\ProductOption42\\Entity\\OptionCategory::ON') %} <div> <h3>{{ optionCategory.name }}</h3> {% for OptionImage in optionCategory.OptionImages %} <img src="{{ asset(OptionImage, 'save_image') }}"/> {% endfor %} <p>{{ optionCategory.description|raw|nl2br }}</p> {% if optionCategory.value|length > 0 %} {% if optionCategory.value > 0 %} {#<p class="plus">{{'productoption.product.option.description.price'|trans}}:{{ priceIncTax(optionCategory.value, Product)|price }} <span class="small">{{'productoption.product.option.description.inc_tax'|trans}}</span></p>#} {% elseif optionCategory.value < 0 %} <p class="minus">{{'productoption.product.option.description.price'|trans}}:{{ priceIncTax(optionCategory.value, Product)|price }} <span class="small">{{'productoption.product.option.description.inc_tax'|trans}}</span></p> {% endif %} {% endif %} {% if optionCategory.delivery_free_flg == constant('Plugin\\ProductOption42\\Entity\\OptionCategory::ON') %} <p>{{'productoption.common.delivery_free'|trans}}</p> {% endif %} <button class="btn-info" id="desc_btn_{{ Option.id }}_{{ optionCategory.id }}" data-type="{{ current_condition }}" >{{'productoption.product.option.description.select'|trans}}</button> </div> {% endif %} {% endfor %} </div> {% endif %} {% endif %} </div> {% set prev_condition = current_condition %} {% set count = count + 1 %} {% set index = index + 1 %} {% endfor %}