app/template/default/Product/recommend.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set body_class = 'product_page' %}
  3. {% block stylesheet %}
  4. <style>
  5. </style>
  6. {% endblock %}
  7. {% block javascript %}
  8.     <script>
  9.         (function(d) {
  10.             var config = {
  11.             kitId: 'pki8bzh',
  12.             scriptTimeout: 0,
  13.             async: true
  14.             },
  15.             h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
  16.         })(document);
  17.     </script>
  18.     
  19.     <script>
  20.         eccube.productsClassCategories = {
  21.             {% for Product in pagination %}
  22.             "{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  23.             {% endfor %}
  24.         };
  25.         $(function() {
  26.             // 検索条件を追加
  27.             $('.btn-condition').click(function() {
  28.                 $('#active_idx').val($(this).index());
  29.             });
  30.             $('.form-check-input').change(function() {
  31.                 $("#form1").submit();
  32.             });
  33.             // 表示件数を変更
  34.             $('.disp-number').change(function() {
  35.                 var dispNumber = $(this).val();
  36.                 $('#disp_number').val(dispNumber);
  37.                 $('#pageno').val(1);
  38.                 $("#form1").submit();
  39.             });
  40.             // 並び順を変更
  41.             $('.order-by').change(function() {
  42.                 var orderBy = $(this).val();
  43.                 $('#orderby').val(orderBy);
  44.                 $('#pageno').val(1);
  45.                 $("#form1").submit();
  46.             });
  47.             $('.add-cart').on('click', function(e) {
  48.                 var $form = $(this).parents('li').find('form');
  49.                 // 規格1フォームの必須チェック
  50.                 var $form_select = $form.parent().find('.form-select');
  51.                 if ($form_select.val() == '__unselected' || $form_select.val() == '') {
  52.                     $form_select[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  53.                     setTimeout(function() {
  54.                         loadingOverlay('hide');
  55.                     }, 100);
  56.                     return true;
  57.                 } else {
  58.                     $form_select[0].setCustomValidity('');
  59.                 }
  60.                 // 個数フォームのチェック
  61.                 var $quantity = $form.parent().find('.quantity');
  62.                 if ($quantity.val() < 1) {
  63.                     $quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  64.                     setTimeout(function() {
  65.                         loadingOverlay('hide');
  66.                     }, 100);
  67.                     return true;
  68.                 } else {
  69.                     $quantity[0].setCustomValidity('');
  70.                 }
  71.                 e.preventDefault();
  72.                 $.ajax({
  73.                     url: $form.attr('action'),
  74.                     type: $form.attr('method'),
  75.                     data: $form.serialize(),
  76.                     dataType: 'json',
  77.                     beforeSend: function(xhr, settings) {
  78.                         // Buttonを無効にする
  79.                         $('.add-cart').prop('disabled', true);
  80.                     }
  81.                 }).done(function(data) {
  82.                     // レスポンス内のメッセージをalertで表示
  83.                     $.each(data.messages, function() {
  84.                         $('#ec-modal-header').text(this);
  85.                     });
  86.                     $('.ec-modal').show()
  87.                     // カートブロックを更新する
  88.                     $.ajax({
  89.                         url: '{{ url('block_cart') }}',
  90.                         type: 'GET',
  91.                         dataType: 'html'
  92.                     }).done(function(html) {
  93.                         $('.ec-headerRole__cart').html(html);
  94.                     });
  95.                 }).fail(function(data) {
  96.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  97.                 }).always(function(data) {
  98.                     // Buttonを有効にする
  99.                     $('.add-cart').prop('disabled', false);
  100.                 });
  101.             });
  102.             $('.favorite').click(function(event) {
  103.                 if ($(this).attr('disabled') != 'disabled') {
  104.                     $(this).closest('li.product').find('.list-add-favorite').submit();
  105.                 }
  106.             });
  107.         });
  108.         $('.ec-modal-wrap').on('click', function(e) {
  109.             // モーダル内の処理は外側にバブリングさせない
  110.             e.stopPropagation();
  111.         });
  112.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  113.             $('.ec-modal').hide()
  114.         });
  115.     </script>
  116.     <script>
  117.         $(document).ready(function(){
  118.             $(".left .list-btn .btn-condition").eq($('#active_idx').val()).addClass('active');
  119.             $(".right .item").eq($('#active_idx').val()).addClass('active');
  120.             $(".left .list-btn .btn-condition").click(function(e){
  121.                 if (!$(this).hasClass("active")) {
  122.                     var tabNum = $(this).index();
  123.                     var nthChild = tabNum+1;
  124.                     $(".left .list-btn .btn-condition.active").removeClass("active");
  125.                     $(this).addClass("active");
  126.                     $(".right .item.active").removeClass("active");
  127.                     $(".right .item:nth-child("+nthChild+")").addClass("active");
  128.                 }
  129.             });
  130.             $(".reset").click(function(e){
  131.                 $(".right .item input[type='checkbox']:checked").prop('checked', false);
  132.                 $("#form1").submit();
  133.             });
  134.         });
  135.     </script>
  136. {% endblock %}
  137. {% block main %}
  138.     <form name="form1" id="form1" method="get" action="?">
  139.         {% for item in search_form %}
  140.             {% if item.vars.value is not iterable %}
  141.                 <input type="hidden" id="{{ item.vars.id }}"
  142.                 name="{{ item.vars.full_name }}"
  143.                 {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  144.             {% endif %}
  145.         {% endfor %}
  146.     </form>
  147.     <div class="ec-featured-product-page">
  148.         <div class="ec-banner">
  149.             <div class="ec-banner__inner">
  150.                 <div class="inner">
  151.                     <h2>
  152.                         おすすめ商品
  153.                     </h2>
  154.                 </div>
  155.             </div>
  156.             <div class="ec-breadcrumb">
  157.                 <ul class="ec-breadcrumb__menu">
  158.                     <li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
  159.                     <li class="ec-breadcrumb__item"><span>></span></li>
  160.                     <li class="ec-breadcrumb__item"><p>おすすめ商品</p></li>
  161.                 </ul>
  162.             </div>
  163.         </div>
  164.         <div class="ec-product-main">
  165.             <div class="ec-product__inner">
  166.                 <div class="inner">
  167.                     {# <div class="group-text">
  168.                         <p>
  169.                             標準設置工事費は、配管テープ巻き(化粧カバーなし)、配管の長さ4メートル以内となります。<br />
  170.                             詳細な工事費用をお見積り希望の方は<a href="{{ url('contact') }}?type=1">こちら</a>からお問合せください。
  171.                         </p>
  172.                         <p class="v2">
  173.                             グランドオープン記念!今ならエアコン本体の購入がお得です!エアコン本体のご予算、おすすめ順、機能などから、お好みのエアコンをお選びください。そのほか、エアコンの工事や取り付けや交換もエアココにお任せくださいませ。
  174.                         </p>
  175.                     </div> #}
  176.                     <div class="ec-reCommended">
  177.                         <div class="message">
  178.                             <div class="group">
  179.                                 <img src="{{ asset('assets/img/common/panda-healthcare_staff.png')}}" alt="">
  180.                             </div>
  181.                             <div class="mess">
  182.                                 <p>エアココの強み! </p> 
  183.                             </div>
  184.                         </div>
  185.                         <div class="message r">
  186.                             <div class="mess">
  187.                                 <p><span>強み①【決済後の追加工事費はかかりません】</span><br />
  188.                                     エアコンの設置工事当日に工事業者から高額な追加費用を請求されたという話をよく聞きます。エアココは事前にエアコン本体価格のみならず設置工事費込み(標準工事費+追加工事費)ですべての金額を算出するので決済後の追加費用は一切かかりません。<br />
  189.                                     <br />
  190.                                     <span>強み➁【最短で取付工事可能】</span><br />
  191.                                     エアココと提携している全国のエアコン設置業者が最短で設置工事を行いますが、特にお急ぎのお客様のために優先して設置工事ができる「特急券」もご用意しています。
  192.                                 </p>
  193.                             </div>
  194.                             <div class="group">
  195.                                 <img src="{{ asset('assets/img/common/kuma-student.png')}}" alt="">
  196.                             </div>
  197.                         </div>
  198.                     </div>
  199. <!-- 
  200.                     <div class="ec-product__banner">
  201.                         <img src="{{ asset('assets/img/product/banner.jpg')}}" alt="">
  202.                     </div> -->
  203.                     {% set is_first = true %}
  204.                     {% for recommendCatId in recommendCats %}
  205.                         {% if recommendCatId == 30 %}
  206.                             {% if is_first == true %}
  207.                             {% set is_first = false %}
  208.                             <div id="group_{{ recommendCatId }}"></div>
  209.                             <div class="ec-product__group first">
  210.                             {% else %}
  211.                             <div id="group_{{ recommendCatId }}"></div>
  212.                             <div class="ec-product__group">
  213.                             {% endif %}
  214.                                 <div class="ec-product__poster">
  215.                                     <img src="{{ asset('assets/img/product/recomment-') }}{{ recommendCatId }}.png">
  216.                                 </div>
  217.                                 {% if pagination.totalItemCount > 0 %}
  218.                                     <ul class="list-product-v2">
  219.                                         {% for Product in pagination %}
  220.                                             {% set in_cat = false %}
  221.                                             {% for ProductCategory in Product.ProductCategories %}
  222.                                                 {% if ProductCategory.Category.id == recommendCatId %}
  223.                                                     {% set in_cat = true %}
  224.                                                 {% endif %}
  225.                                             {% endfor %}
  226.                                             {% if in_cat == true and Product.id <= 106 %}
  227.                                                 {% set num_1 = (Product.getPrice02IncTaxMin / 1000) %}
  228.                                                 {% set num_2 = Product.getPrice02IncTaxMin % 1000 %}
  229.                                                 {% set num_2_formatted = num_2 %}
  230.                                                 {% if num_2_formatted < 100 %}
  231.                                                     {% set num_2_formatted = "0" ~ num_2_formatted %}
  232.                                                 {% endif %}
  233.                                                 <li class="product-v2">
  234.                                                     <a href="{{ url('product_detail', {'id': Product.id}) }}">
  235.                                                         <span class="circle">
  236.                                                             <img src="{{ asset('assets/img/common/ic-arrow-blue.png') }}" alt="">
  237.                                                         </span>
  238.                                                         <div class="group">
  239.                                                             <div class="code">
  240.                                                                 {% if Product.ProductCategories is not empty %}
  241.                                                                     {% for ProductCategory in Product.ProductCategories %}
  242.                                                                         {% if ProductCategory.Category.Parent is not empty %}
  243.                                                                             {% set parentCat = ProductCategory.Category.Parent %}
  244.                                                                             {% if parentCat.id == 19 %}
  245.                                                                                 <span>主に{{ ProductCategory.Category.name }}</span>
  246.                                                                             {% endif %}
  247.                                                                         {% endif %}
  248.                                                                     {% endfor %}
  249.                                                                 {% endif %}
  250.                                                                 <p>{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</p>
  251.                                                             </div>
  252.                                                             <span class="text">標準工事費込み</span>
  253.                                                             <div class="price">
  254.                                                                 <p class="price__val">
  255.                                                                     <span class="yen" title="¥">¥</span><span class="num-1" title="{{ num_1|round(0, 'floor') }},">{{ num_1|round(0, 'floor') }},</span><span class="num-2" title="{{ num_2_formatted }}">{{ num_2_formatted }}</span>
  256.                                                                 </p>
  257.                                                                 <span class="price__tax">(税込)</span>
  258.                                                             </div>
  259.                                                         </div>
  260.                                                     </a>
  261.                                                 </li>
  262.                                             {% endif %}
  263.                                         {% endfor %}
  264.                                     </ul>
  265.                                 {% endif %}
  266.                             </div>
  267.                             <div id="group_{{ recommendCatId }}-2"></div>
  268.                             <div class="ec-product__group">
  269.                                 <div class="ec-product__poster">
  270.                                     <img src="{{ asset('assets/img/product/recomment-') }}{{ recommendCatId }}-2.png">
  271.                                 </div>
  272.                                 {% if pagination.totalItemCount > 0 %}
  273.                                     <ul class="list-product-v2">
  274.                                         {% for Product in pagination %}
  275.                                             {% set in_cat = false %}
  276.                                             {% for ProductCategory in Product.ProductCategories %}
  277.                                                 {% if ProductCategory.Category.id == recommendCatId %}
  278.                                                     {% set in_cat = true %}
  279.                                                 {% endif %}
  280.                                             {% endfor %}
  281.                                             {% if in_cat == true and Product.id > 106 %}
  282.                                                 {% set num_1 = Product.getPrice02IncTaxMin / 1000 %}
  283.                                                 {% set num_2 = Product.getPrice02IncTaxMin % 1000 %}
  284.                                                 {% set num_2_formatted = num_2 %}
  285.                                                 {% if num_2_formatted < 100 %}
  286.                                                     {% set num_2_formatted = "0" ~ num_2_formatted %}
  287.                                                 {% endif %}
  288.                                                 <li class="product-v2">
  289.                                                     <a href="{{ url('product_detail', {'id': Product.id}) }}">
  290.                                                         <span class="circle">
  291.                                                             <img src="{{ asset('assets/img/common/ic-arrow-blue.png') }}" alt="">
  292.                                                         </span>
  293.                                                         <div class="group">
  294.                                                             <div class="code">
  295.                                                                 {% if Product.ProductCategories is not empty %}
  296.                                                                     {% for ProductCategory in Product.ProductCategories %}
  297.                                                                         {% if ProductCategory.Category.Parent is not empty %}
  298.                                                                             {% set parentCat = ProductCategory.Category.Parent %}
  299.                                                                             {% if parentCat.id == 19 %}
  300.                                                                                 <span>主に{{ ProductCategory.Category.name }}</span>
  301.                                                                             {% endif %}
  302.                                                                         {% endif %}
  303.                                                                     {% endfor %}
  304.                                                                 {% endif %}
  305.                                                                 <p>{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</p>
  306.                                                             </div>
  307.                                                             <span class="text">標準工事費込み</span>
  308.                                                             <div class="price">
  309.                                                                 <p class="price__val">
  310.                                                                     <span class="yen" title="¥">¥</span><span class="num-1" title="{{ num_1|round(0, 'floor') }},">{{ num_1|round(0, 'floor') }},</span><span class="num-2" title="{{ num_2_formatted }}">{{ num_2_formatted }}</span>
  311.                                                                 </p>
  312.                                                                 <span class="price__tax">(税込)</span>
  313.                                                             </div>
  314.                                                         </div>
  315.                                                     </a>
  316.                                                 </li>
  317.                                             {% endif %}
  318.                                         {% endfor %}
  319.                                     </ul>
  320.                                 {% endif %}
  321.                             </div>
  322.                         {% else %}
  323.                             {% if is_first == true %}
  324.                             {% set is_first = false %}
  325.                             <div id="group_{{ recommendCatId }}"></div>
  326.                             <div class="ec-product__group first">
  327.                             {% else %}
  328.                             <div id="group_{{ recommendCatId }}"></div>
  329.                             <div class="ec-product__group">
  330.                             {% endif %}
  331.                                 <div class="ec-product__poster">
  332.                                     <img src="{{ asset('assets/img/product/recomment-') }}{{ recommendCatId }}.png">
  333.                                 </div>
  334.                                 {% if pagination.totalItemCount > 0 %}
  335.                                     <ul class="list-product-v2">
  336.                                         {% for Product in pagination %}
  337.                                             {% set in_cat = false %}
  338.                                             {% for ProductCategory in Product.ProductCategories %}
  339.                                                 {% if ProductCategory.Category.id == recommendCatId %}
  340.                                                     {% set in_cat = true %}
  341.                                                 {% endif %}
  342.                                             {% endfor %}
  343.                                             {% if in_cat == true %}
  344.                                                 {% set num_1 = Product.getPrice02IncTaxMin / 1000 %}
  345.                                                 {% set num_2 = Product.getPrice02IncTaxMin % 1000 %}
  346.                                                 {% set num_2_formatted = num_2 %}
  347.                                                 {% if num_2_formatted < 100 %}
  348.                                                     {% set num_2_formatted = "0" ~ num_2_formatted %}
  349.                                                 {% endif %}
  350.                                                 <li class="product-v2">
  351.                                                     <a href="{{ url('product_detail', {'id': Product.id}) }}">
  352.                                                         <span class="circle">
  353.                                                             <img src="{{ asset('assets/img/common/ic-arrow-blue.png') }}" alt="">
  354.                                                         </span>
  355.                                                         <div class="group">
  356.                                                             <div class="code">
  357.                                                                 {% if Product.ProductCategories is not empty %}
  358.                                                                     {% for ProductCategory in Product.ProductCategories %}
  359.                                                                         {% if ProductCategory.Category.Parent is not empty %}
  360.                                                                             {% set parentCat = ProductCategory.Category.Parent %}
  361.                                                                             {% if parentCat.id == 19 %}
  362.                                                                                 <span>主に{{ ProductCategory.Category.name }}</span>
  363.                                                                             {% endif %}
  364.                                                                         {% endif %}
  365.                                                                     {% endfor %}
  366.                                                                 {% endif %}
  367.                                                                 <p>{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</p>
  368.                                                             </div>
  369.                                                             <span class="text">標準工事費込み</span>
  370.                                                             <div class="price">
  371.                                                                 <p class="price__val">
  372.                                                                     <span class="yen" title="¥">¥</span><span class="num-1" title="{{ num_1|round(0, 'floor') }},">{{ num_1|round(0, 'floor') }},</span><span class="num-2" title="{{ num_2_formatted }}">{{ num_2_formatted }}</span>
  373.                                                                 </p>
  374.                                                                 <span class="price__tax">(税込)</span>
  375.                                                             </div>
  376.                                                         </div>
  377.                                                     </a>
  378.                                                 </li>
  379.                                             {% endif %}
  380.                                         {% endfor %}
  381.                                     </ul>
  382.                                 {% endif %}
  383.                             </div>
  384.                         {% endif %}
  385.                         
  386.                     {% endfor %}
  387.                 </div>
  388.             </div>
  389.         </div>
  390.     </div>
  391. {% endblock %}