app/template/aneros2023/Product/list.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'product_page' %}
  10. {% block javascript %}
  11.     <script>
  12.         eccube.productsClassCategories = {
  13.             {% for Product in pagination %}
  14.             "{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  15.             {% endfor %}
  16.         };
  17.         $(function() {
  18.             // 表示件数を変更
  19.             $('.disp-number').change(function() {
  20.                 var dispNumber = $(this).val();
  21.                 $('#disp_number').val(dispNumber);
  22.                 $('#pageno').val(1);
  23.                 $("#form1").submit();
  24.             });
  25.             // 並び順を変更
  26.             $('.order-by').change(function() {
  27.                 var orderBy = $(this).val();
  28.                 $('#orderby').val(orderBy);
  29.                 $('#pageno').val(1);
  30.                 $("#form1").submit();
  31.             });
  32.             $('.add-cart').on('click', function(e) {
  33.                 var $form = $(this).parents('li').find('form');
  34.                 // 個数フォームのチェック
  35.                 var $quantity = $form.parent().find('.quantity');
  36.                 if ($quantity.val() < 1) {
  37.                     $quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  38.                     setTimeout(function() {
  39.                         loadingOverlay('hide');
  40.                     }, 100);
  41.                     return true;
  42.                 } else {
  43.                     $quantity[0].setCustomValidity('');
  44.                 }
  45.                 e.preventDefault();
  46.                 $.ajax({
  47.                     url: $form.attr('action'),
  48.                     type: $form.attr('method'),
  49.                     data: $form.serialize(),
  50.                     dataType: 'json',
  51.                     beforeSend: function(xhr, settings) {
  52.                         // Buttonを無効にする
  53.                         $('.add-cart').prop('disabled', true);
  54.                     }
  55.                 }).done(function(data) {
  56.                     // レスポンス内のメッセージをalertで表示
  57.                     $.each(data.messages, function() {
  58.                         $('#ec-modal-header').text(this);
  59.                     });
  60.                     $('.ec-modal').show()
  61.                     // カートブロックを更新する
  62.                     $.ajax({
  63.                         url: '{{ url('block_cart') }}',
  64.                         type: 'GET',
  65.                         dataType: 'html'
  66.                     }).done(function(html) {
  67.                         $('.ec-headerRole__cart').html(html);
  68.                     });
  69.                 }).fail(function(data) {
  70.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  71.                 }).always(function(data) {
  72.                     // Buttonを有効にする
  73.                     $('.add-cart').prop('disabled', false);
  74.                 });
  75.             });
  76.         });
  77.         $('.ec-modal-overlay, .ec-modal .ec-inlineBtn--cancel').on('click', function() {
  78.             $('.ec-modal').hide()
  79.         });
  80.     </script>
  81. {% endblock %}
  82. {% block main %}
  83. {% set cp = getProductList(7) %}
  84.     {% if search_form.category_id.vars.errors|length > 0 %}
  85.         <div class="ec-searchnavRole container">
  86.             <p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  87.         </div>
  88.     {% else %}
  89.     <div class="breadcrumbs">
  90.         <div class="container">
  91.             <ul>
  92.                 <li>
  93.                     <a href="{{ url('homepage') }}" title="トップページに戻る">
  94.                         <span>トップページ</span></a>
  95.                     <span>></span>
  96.                 </li>
  97.                 <li>
  98.                     {% if Category is not null %}
  99.                         {% for Path in Category.path %}
  100.                             <span>「{{ Path.name }}」</span>
  101.                         {% endfor %}
  102.                     {% elseif search_form.vars.value and search_form.vars.value.name %}
  103.                         <span>検索結果:{{ search_form.vars.value.name }}</span></a>
  104.                     {% else %}
  105.                         <a href="{{ url('product_list') }}"><span>全商品</span></a>
  106.                     {% endif %}
  107.                 </li>
  108.             </ul>
  109.             {% if Category is not null %}
  110.             {% elseif search_form.vars.value and search_form.vars.value.name %}
  111.             {% else %}
  112.                 <h1 class="all-text">全商品一覧</h1>
  113.             {% endif %}
  114.             
  115.             {#
  116.             {% if Category is not null %}
  117.             {% elseif search_form.vars.value and search_form.vars.value.name %}
  118.             {% else %}
  119.                 <img src="{{ asset('aneros/img/campaign/2023-autumn-sale-all-list.png') }}" style="position:absolute; left:0; max-width:175px">
  120.                 <h1 class="all-text" style="padding-left:60px; padding-top:65px;">全商品一覧</h1>
  121.             {% endif %}
  122.             #}
  123.             
  124.             {% if search_form.vars.value and search_form.vars.value.name %}
  125.                 <style>
  126.                     #page_product_list .ec-searchnavRole {width: 100%; display:block;}
  127.                 </style>
  128.             {% endif %}
  129.             
  130.             <div class="ec-searchnavRole">
  131.                 <form name="form1" id="form1" method="get" action="?">
  132.                     {% for item in search_form %}
  133.                         <input type="hidden" id="{{ item.vars.id }}" name="{{ item.vars.full_name }}" {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  134.                     {% endfor %}
  135.                 </form>
  136.                 {#
  137.                 <div class="ec-searchnavRole__topicpath">
  138.                     <ol class="ec-topicpath">
  139.                         <li class="ec-topicpath__item"><a href="{{ url('product_list') }}">{{ '全て'|trans }}</a></li>
  140.                         {% if Category is not null %}
  141.                             {% for Path in Category.path %}
  142.                                 <li class="ec-topicpath__divider">|</li>
  143.                                 <li class="ec-topicpath__item{% if loop.last %}--active{% endif %}"><a href="{{ url('product_list') }}?category_id={{ Path.id }}">{{ Path.name }}</a></li>
  144.                             {% endfor %}
  145.                         {% endif %}
  146.                         {% if search_form.vars.value and search_form.vars.value.name %}
  147.                             <li class="ec-topicpath__divider">|</li>
  148.                             <li class="ec-topicpath__item">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
  149.                         {% endif %}
  150.                     </ol>
  151.                 </div>
  152.                 #}
  153.                 <div class="ec-searchnavRole__infos">
  154.                     {#
  155.                     <div class="ec-searchnavRole__counter">
  156.                         {% if pagination.totalItemCount > 0 %}
  157.                             {{ '<span class="ec-font-bold">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  158.                         {% else %}
  159.                             <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  160.                         {% endif %}
  161.                     </div>
  162.                     #}
  163.                     {% if pagination.totalItemCount > 0 %}
  164.                         <div class="ec-searchnavRole__actions">
  165.                             <div class="ec-select">
  166.                                 <span>並び替え:</span>
  167.                                 {#{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }#}
  168.                                 {{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
  169.                             </div>
  170.                         </div>
  171.                     {% endif %}
  172.                 </div>
  173.             </div>
  174.         </div>
  175.     </div>
  176.         {% if pagination.totalItemCount > 0 %}
  177.             <div class="ec-shelfRole container">
  178.                 <ul class="ec-shelfGrid flexbox">
  179.                     {% for Product in pagination %}
  180.                         {% set campaignProduct, newProduct, limitedProduct = false, false, false %}
  181.                         {% for ProductTag in Product.ProductTag %}
  182.                             {% if ProductTag.Tag.id == 100 %}
  183.                                 {% set campaignProduct = true %}
  184.                             {% elseif ProductTag.Tag.id == 1 %}
  185.                                 {% set newProduct = true %}
  186.                             {% elseif ProductTag.Tag.id == 3 %}
  187.                                 {% set limitedProduct = true %}
  188.                             {% endif %}
  189.                         {% endfor %}
  190.                         {% if campaignProduct == true %}
  191.                         <li class="ec-shelfGrid__item flexbox campaignProduct">
  192.                         {% elseif newProduct == true %}
  193.                         <li class="ec-shelfGrid__item flexbox newProduct">
  194.                         {% elseif limitedProduct == true %}
  195.                         <li class="ec-shelfGrid__item flexbox limitedProduct">
  196.                         {% else %}
  197.                         <li class="ec-shelfGrid__item flexbox">
  198.                         {% endif %}
  199.                             <a href="{{ url('product_detail', {'id': Product.id}) }}">
  200.                                 <p class="ec-shelfGrid__item-image">
  201.                                     {% if campaignProduct == true %}
  202.                                     <img class="campaignProductImage" src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  203.                                     {% elseif newProduct == true %}
  204.                                     <img class="newProductImage" src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  205.                                     {% elseif limitedProduct == true %}
  206.                                     <img class="limitedProductImage" src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  207.                                     {% else %}
  208.                                     <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  209.                                     {% endif %}
  210.                                 </p>
  211.                                 <p>{{ Product.name }}</p>
  212.                             </a>
  213.                             <div class="bottom-box flexbox" id="productForm{{ Product.id }}">
  214.                                 <div class="price-box">
  215.                                     <span class="price">
  216.                                         <div class="normal_price" id="product-normal-price-{{ Product.id }}">
  217.                                             {% if  Product.getPrice01Min is not null and Product.getPrice01IncTaxMin != 0 %}
  218.                                                 {% if Product.hasProductClass %}
  219.                                                     {% if Product.getPrice01Min == Product.getPrice01Max %}
  220.                                                         <span class="price">{{ Product.getPrice01IncTaxMin|price }}<span class="inctax"> (税込)</span></span>
  221.                                                     {% else %}
  222.                                                         <span class="price">{{ Product.getPrice01IncTaxMin|price }}<!-- ~ {{ Product.getPrice01IncTaxMax|price }}--><span class="inctax"> (税込)</span></span>
  223.                                                     {% endif %}
  224.                                                 {% else %}
  225.                                                         <span class="price">{{ Product.getPrice01IncTaxMin|price }}<span class="inctax"> (税込)</span></span>
  226.                                                 {% endif %}
  227.                                             {% endif %}
  228.                                                 </div>
  229.                                                 <div class="sale_price" id="product-price-{{ Product.id }}">
  230.                                             {% if Product.hasProductClass %}
  231.                                                 {% if Product.getPrice02Min == Product.getPrice02Max %}
  232.                                                     <span class="price">{{ Product.getPrice02IncTaxMin|price }}<span class="inctax"> (税込)</span></span>
  233.                                                 {% else %}
  234.                                                     <span class="price">{{ Product.getPrice02IncTaxMin|price }}<!-- ~ {{ Product.getPrice02IncTaxMax|price }}--><span class="inctax"> (税込)</span></span>
  235.                                                 {% endif %}
  236.                                             {% else %}
  237.                                                     <span class="price">{{ Product.getPrice02IncTaxMin|price }}<span class="inctax"> (税込)</span></span>
  238.                                             {% endif %}
  239.                                         </div>
  240.                                     </span>
  241.                                 </div>
  242.                                 <div class="actions">
  243.                                 {% if Product.stock_find %}
  244.                                     {% if Product.hasProductClass %}
  245.                                         <a class="button btn-cart learn-more" title="商品詳細" href="{{ url('product_detail', {'id': Product.id}) }}">
  246.                                             <span>
  247.                                                 <span>商品詳細</span>
  248.                                             </span>
  249.                                         </a>
  250.                                     {% else %}
  251.                                         <button type="button" title="カゴに入れる" class="button btn-cart one-click-add-cart" 
  252.                                         data-action="{{ url('product_add_cart', {id:Product.id}) }}" 
  253.                                         data-product_id="{{ Product.id }}" data-product_name="{{ Product.name }}"  data-product_img="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}"
  254.                                         data-product_class="{{ Product.ProductClasses[0].id }}" 
  255.                                         data-token="{{ csrf_token('Eccube\\Form\\Type\\AddCartType') }}">
  256.                                             <span>カゴに入れる</span>
  257.                                         </button>
  258.                                     {% endif %}
  259.                                 {% else %}
  260.                                     {% set arrivemail = true %}
  261.                                     {% for ProductTag in Product.ProductTag %}
  262.                                         {% if ProductTag.Tag.id == 99 %}
  263.                                             {% set arrivemail = false %}
  264.                                         {% endif %}
  265.                                     {% endfor %}
  266.                                     
  267.                                     {% if arrivemail %}
  268.                                         <button type="button" data-productid="{{ Product.id }}" data-productname="{{ Product.name }}" title="入荷お知らせ" class="button btn-cart add-to-mail">
  269.                                             <span>入荷お知らせ</span>
  270.                                         </button>
  271.                                     {% else %}
  272.                                         <button type="button" title="在庫切れ" class="button btn-cart add-to-cart-out">
  273.                                             <span>在庫切れ</span>
  274.                                         </button>
  275.                                     {% endif %}
  276.                                 {% endif %}
  277.                                 </div>
  278.                             </div>
  279.                             {#
  280.                             {% if Product.stock_find %}
  281.                                 {% set form = forms[Product.id] %}
  282.                                 <form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_add_cart', {id:Product.id}) }}" method="post">
  283.                                     <div class="ec-productRole__actions">
  284.                                         {% if form.classcategory_id1 is defined %}
  285.                                             <div class="ec-select">
  286.                                                 {{ form_widget(form.classcategory_id1) }}
  287.                                                 {{ form_errors(form.classcategory_id1) }}
  288.                                             </div>
  289.                                             {% if form.classcategory_id2 is defined %}
  290.                                                 <div class="ec-select">
  291.                                                     {{ form_widget(form.classcategory_id2) }}
  292.                                                     {{ form_errors(form.classcategory_id2) }}
  293.                                                 </div>
  294.                                             {% endif %}
  295.                                         {% endif %}
  296.                                         <div class="ec-numberInput"><span>{{ '数量'|trans }}</span>
  297.                                             {{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
  298.                                             {{ form_errors(form.quantity) }}
  299.                                         </div>
  300.                                     </div>
  301.                                     {{ form_rest(form) }}
  302.                                 </form>
  303.                                 <div class="ec-productRole__btn">
  304.                                     <button type="submit" class="ec-blockBtn--action add-cart" data-cartid="{{ Product.id }}" form="productForm{{ Product.id }}">
  305.                                         {{ 'カートに入れる'|trans }}
  306.                                     </button>
  307.                                 </div>
  308.                             {% else %}
  309.                                 <div class="ec-productRole__btn">
  310.                                     <button type="button" class="ec-blockBtn--action" disabled="disabled">
  311.                                         {{ 'ただいま品切れ中です。'|trans }}
  312.                                     </button>
  313.                                 </div>
  314.                             {% endif %}
  315.                             #}
  316.                         </li>
  317.                     {% endfor %}
  318.                 </ul>
  319.             </div>
  320.             {#
  321.             <div class="ec-modal">
  322.                 <div class="ec-modal-overlay">
  323.                     <div class="ec-modal-wrap">
  324.                         <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  325.                         <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  326.                         <div class="ec-modal-box">
  327.                             <div class="ec-role">
  328.                                 <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  329.                                 <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  330.                             </div>
  331.                         </div>
  332.                     </div>
  333.                 </div>
  334.             </div>
  335.             <div class="ec-pagerRole">
  336.                 {% include "pager.twig" with {'pages': pagination.paginationData} %}
  337.             </div>
  338.             #}
  339.         {% else %}
  340.             <div class="ec-shelfRole container">
  341.                 <span>商品が見つかりませんでした。</span>
  342.             </div>
  343.         {% endif %}
  344.     {% endif %}
  345. {# カートに入れる #}
  346. <div id="in_to_cart" style="display: none;"><img src="{{ asset('aneros/img/common/loading.gif') }}" alt="" />
  347.     <p>カートに入れています</p>
  348. </div>
  349. <div id="in_to_cart_end" style="display: none;">
  350.     <a href="javascript: void(0)" onclick="$('#in_to_cart_end #in_to_cart_reload').click();" class="btn-remove">Close</a>
  351.     <div id="in_to_cart_msg">
  352.         商品がカートに入りました
  353.     </div>
  354.     <div id="in_to_cart_image">
  355.         <img src="" alt="">
  356.     </div>
  357.     <div id="in_to_cart_name">
  358.         
  359.     </div>
  360.     <button id="in_to_cart_reload" class="button" onclick="location.reload();">お買い物を続ける</button>
  361.     <a href="{{ url('cart') }}" id="in_to_cart_cart" class="button">購入手続き</a>
  362. </div>
  363. {# 入荷お知らせ登録 #}
  364. <div id="arrivemail-area" style="display: none;">
  365.     <div id="arrive-area">
  366.         <div id="arrive-title">
  367.             入荷お知らせ(入力ページ)
  368.             <a class="arrivemail-close" href="javascript:void(0)">X</a>
  369.         </div>
  370.         <div class="arrive-inbox">
  371.             <div id="arrive-sub1">
  372.                 下記の製品が入荷いたしましたらメールでお知らせいたします。
  373.             </div>
  374.         </div>
  375.         <div class="arrive-inbox">
  376.             <div class="arrive-itemname">商品名:</div>
  377.             <div class="arrive-item" id="product-name"></div>
  378.         </div>
  379.         <div class="arrive-inbox" style="margin-bottom:10px;">
  380.             <div class="arrive-itemname-comment">メールアドレス</div>
  381.             <div class="arrive-item">
  382.                 <span class="inputholder inputholder1" style="width:262px;background-position:0 -29px;">
  383.                     <input type="email" name="arrivemail-mail" value="" maxlength="50" class="box350" />
  384.                 </span>
  385.                 <span class="attention">※ 正しいメールアドレスを入力してください。</span>
  386.             </div>
  387.         </div>
  388.         <div class="arrive-inbox">
  389.             <div style="margin-bottom:10px;margin-right:15px;">
  390.                 <font color="#FF0000"><small><b>*</b></small></font>商品の入荷をお知らせするメールサービスです。ご予約を行うものではありません。
  391.             </div>
  392.         </div>
  393.         <div class="arrive-inbox">
  394.             <div style="margin-bottom:10px;margin-right:15px;">
  395.                 <font color="#FF0000"><small><b>*</b></small></font>携帯メールの場合はドメイン解除の設定をお願いいたします。
  396.             </div>
  397.         </div>
  398.         <div class="arrive-inbox">
  399.             <div style="margin-bottom:10px;margin-right:15px;">
  400.                 <font color="#FF0000"><small><b>*</b></small></font>お客様の迷惑メールの設定によってメールがお届けできない場合がございます。
  401.             </div>
  402.         </div>
  403.         <div class="arrive-line"></div>
  404.         <div class="arrive-submitbtn"><a href="javascript:void(0)" class="button blue-btn" name="conf"
  405.                 id="arrivemail-submit">登録します</a></div>
  406.     </div>
  407. </div>
  408. <div id="arrivemail-area-end" style="display: none;">
  409.     <div id="arrive-area">
  410.         <div id="arrive-title">入荷お知らせ(完了ページ)
  411.             <a class="arrivemail-close" href="javascript:void(0)">X</a>
  412.         </div>
  413.         <div class="arrive-inbox">
  414.             <div id="arrive-sub1">メールアドレスを受付けました。</div>
  415.         </div>
  416.         <div class="arrive-inbox">
  417.             <div class="arrive-itemname">商品名:</div>
  418.             <div class="arrive-item" id="product-name"></div>
  419.         </div>
  420.         <div class="arrive-inbox">
  421.             <div class="arrive-itemname-comment">メールアドレス:</div>
  422.             <div class="arrive-item" id="send-arrivemail-mail"></div>
  423.         </div>
  424.         <div class="arrive-inbox">
  425.             <div style="margin-bottom:10px;margin-right:15px;">商品が入荷いたしましたらメールでお知らせいたします。</div>
  426.         </div>
  427.         <div class="arrive-line"></div>
  428.         <div class="arrive-submitbtn">
  429.             <a href="javascript:void(0)" class="button grey-btn grey-btn-mail" name="conf" id="arrivemail-submit-end">閉じます</a>
  430.         </div>
  431.     </div>
  432. </div>
  433.     <div class="swooth-wrapper grey-swooth">
  434.     </div>
  435.     {% endblock %}