app/template/default/index.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. {% set category = app.request.get('category_id') %}
  11. {% set categoryId = app.request.get('category_id')|default(8) %}
  12. {% block javascript %}
  13.     <script>
  14.         $(function() {
  15.             // 表示件数を変更
  16.             $('.disp-number').change(function() {
  17.                 var dispNumber = $(this).val();
  18.                 $('#disp_number').val(dispNumber);
  19.                 $('#pageno').val(1);
  20.                 $("#form1").submit();
  21.             });
  22.             // 並び順を変更
  23.             $('.order-by').change(function() {
  24.                 var orderBy = $(this).val();
  25.                 $('#orderby').val(orderBy);
  26.                 $('#pageno').val(1);
  27.                 $("#form1").submit();
  28.             });
  29.             $('.add-cart').on('click', function(e) {
  30.                 var $form = $(this).parents('li').find('form');
  31.                 // 個数フォームのチェック
  32.                 var $quantity = $form.parent().find('.quantity');
  33.                 if ($quantity.val() < 1) {
  34.                     $quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  35.                     setTimeout(function() {
  36.                         loadingOverlay('hide');
  37.                     }, 100);
  38.                     return true;
  39.                 } else {
  40.                     $quantity[0].setCustomValidity('');
  41.                 }
  42.                 e.preventDefault();
  43.                 $.ajax({
  44.                     url: $form.attr('action'),
  45.                     type: $form.attr('method'),
  46.                     data: $form.serialize(),
  47.                     dataType: 'json',
  48.                     beforeSend: function(xhr, settings) {
  49.                         // Buttonを無効にする
  50.                         $('.add-cart').prop('disabled', true);
  51.                     }
  52.                 }).done(function(data) {
  53.                     // レスポンス内のメッセージをalertで表示
  54.                     $.each(data.messages, function() {
  55.                         $('#ec-modal-header').text(this);
  56.                     });
  57.                     $('.ec-modal').show()
  58.                     // カートブロックを更新する
  59.                     $.ajax({
  60.                         url: '{{ url('block_cart') }}',
  61.                         type: 'GET',
  62.                         dataType: 'html'
  63.                     }).done(function(html) {
  64.                         $('.ec-headerRole__cart').html(html);
  65.                     });
  66.                 }).fail(function(data) {
  67.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  68.                 }).always(function(data) {
  69.                     // Buttonを有効にする
  70.                     $('.add-cart').prop('disabled', false);
  71.                 });
  72.             });
  73.         });
  74.         $('.ec-modal-wrap').on('click', function(e) {
  75.             // モーダル内の処理は外側にバブリングさせない
  76.             e.stopPropagation();
  77.         });
  78.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  79.             $('.ec-modal').hide()
  80.         });
  81.     </script>
  82.     {% if categoryId == 8 %}
  83.     <script src="/html/user_data/assets/js/itemload/category-top.js"></script>
  84.     {% endif %}
  85. {% endblock %}
  86. {% block main %}
  87.     <link rel="stylesheet" href="/html/user_data/assets/js/slick-1.6.0/slick.css">
  88.     <script src="/html/user_data/assets/js/slick-1.6.0/slick.min.js"></script>
  89.     <script>
  90.         $(function(){
  91.               $(".top-main2-gallery").slick({
  92.                 autoplay: true,
  93.                 autoplaySpeed: 0,
  94.                 speed: 10000,
  95.                 cssEase: "linear",
  96.                 dots: false,
  97.                 arrows:false,
  98.                 slidesToShow: 1,
  99.                 variableWidth: true,
  100.                  responsive: [
  101.                   {
  102.                     breakpoint: 750,
  103.                     settings: {
  104.                       variableWidth: false,
  105.                     }
  106.                   }
  107.                 ]
  108.               });
  109.         });
  110.     </script>
  111.     <section class="top-main2">
  112.         <img src="/html/user_data/assets/img/common/top/txt--main-01.svg" alt="選ぶ時間も、味わう時間も豊かに" class="top-main2__catch01">
  113.         <img src="/html/user_data/assets/img/common/top/txt--main-02.svg" alt="Your naturals" class="top-main2__catch02">
  114.         <ul class="top-main2-gallery">
  115.             <li class="top-main2-gallery__item">
  116.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-01.webp" alt="">
  117.             </li>
  118.             <li class="top-main2-gallery__item">
  119.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-02.webp" alt="">
  120.             </li>
  121.             <li class="top-main2-gallery__item">
  122.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-03.webp" alt="">
  123.             </li>
  124.             <li class="top-main2-gallery__item">
  125.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-04.webp" alt="">
  126.             </li>
  127.             <li class="top-main2-gallery__item">
  128.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-05.webp" alt="">
  129.             </li>
  130.             <li class="top-main2-gallery__item">
  131.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-06.webp" alt="">
  132.             </li>
  133.             <li class="top-main2-gallery__item">
  134.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-07.webp" alt="">
  135.             </li>
  136.             <li class="top-main2-gallery__item">
  137.                 <img src="/html/user_data/assets/img/common/top/pic--gallery-08.webp" alt="">
  138.             </li>
  139.         </ul>
  140.     </section>
  141. {% if categoryId == 8 %}
  142. <!--<div class="category-search-wrap hide">
  143. <button class="category-search-btn">開く</button>
  144. <div class="category-search">
  145. <ul class="category-search__tab">
  146. <li><a href="#type">種類</a></li>
  147. <li><a href="#area">地域</a></li>
  148. <li><a href="#breed">品種</a></li>
  149. <li><a href="#category">カテゴリー</a></li>
  150. <li><a href="#scene">シーン別</a></li>
  151. <li><a href="#price">値段から</a></li>
  152. </ul>
  153. <div id="type" class="active category-search-block">
  154. <ul class="category-search__list">
  155. {% set Categories = repository('Eccube\\Entity\\Category').getList(repository('Eccube\\Entity\\Category').find(8)) %}
  156. {% macro tree(Category) %}
  157. {% from _self import tree %}
  158. <li>
  159. <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  160. {{ Category.name }}
  161. </a>
  162. {% if Category.children|length > 0 %}
  163. <ul>
  164. {% for ChildCategory in Category.children %}
  165. <li>
  166. {{ tree(ChildCategory) }}
  167. </li>
  168. {% endfor %}
  169. </ul>
  170. {% endif %}
  171. </li>
  172. {% endmacro %}
  173. {# @see https://github.com/bolt/bolt/pull/2388 #}
  174. {% from _self import tree %}
  175. {% for Category in Categories %}
  176. <li>
  177. {{ tree(Category) }}
  178. </li>
  179. {% endfor %}
  180. </ul>
  181. </div>
  182. <div id="area" class="category-search-block">
  183. <ul class="category-search__list">
  184. {% set Categories = repository('Eccube\\Entity\\Category').getList(repository('Eccube\\Entity\\Category').find(21)) %}
  185. {% macro tree(Category) %}
  186. {% from _self import tree %}
  187. <li>
  188. <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  189. {{ Category.name }}
  190. </a>
  191. </li>
  192. {% endmacro %}
  193. {# @see https://github.com/bolt/bolt/pull/2388 #}
  194. {% from _self import tree %}
  195. {% for Category in Categories %}
  196. <li>
  197. {{ tree(Category) }}
  198. </li>
  199. {% endfor %}
  200. </ul>
  201. </div>
  202. <div id="breed" class="category-search-block">
  203. <ul class="category-search__list">
  204. <li><a href="#">品種</a></li>
  205. <li><a href="#">品種</a></li>
  206. <li><a href="#">品種</a></li>
  207. <li><a href="#">品種</a></li>
  208. <li><a href="#">品種</a></li>
  209. </ul>
  210. </div>
  211. <div id="category" class="category-search-block">
  212. <ul class="category-search__list">
  213. <li><a href="#">カテゴリ</a></li>
  214. <li><a href="#">カテゴリ</a></li>
  215. <li><a href="#">カテゴリ</a></li>
  216. <li><a href="#">カテゴリ</a></li>
  217. <li><a href="#">カテゴリ</a></li>
  218. </ul>
  219. </div>
  220. <div id="scene" class="category-search-block">
  221. <ul class="category-search__list">
  222. <li><a href="#">フランス</a></li>
  223. <li><a href="#">フランス</a></li>
  224. <li><a href="#">フランス</a></li>
  225. <li><a href="#">フランス</a></li>
  226. <li><a href="#">フランス</a></li>
  227. </ul>
  228. </div>
  229. <div id="price" class="category-search-block">
  230. <ul class="category-search__list">
  231. <li><a href="#">1000円〜2000円</a></li>
  232. <li><a href="#">1000円〜2000円</a></li>
  233. <li><a href="#">1000円〜2000円</a></li>
  234. <li><a href="#">1000円〜2000円</a></li>
  235. <li><a href="#">1000円〜2000円</a></li>
  236. </ul>
  237. </div>
  238. </div>
  239. </div>--><!-- /.category-search-wrap-->
  240. {% endif %}
  241.         <div class="product-container layout-container contents wine-{{categoryId}}">
  242. <!-- test -->
  243. <!--
  244. {% set Categories = repository('Eccube\\Entity\\Category').getList(repository('Eccube\\Entity\\Category').find(8)) %}
  245. {% macro tree(Category) %}
  246. {% from _self import tree %}
  247. <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  248. {{ Category.name }}
  249. </a>
  250. {% if Category.children|length > 0 %}
  251. <ul>
  252. {% for ChildCategory in Category.children %}
  253. <li>
  254. {{ tree(ChildCategory) }}
  255. </li>
  256. {% endfor %}
  257. </ul>
  258. {% endif %}
  259. {% endmacro %}
  260. {# @see https://github.com/bolt/bolt/pull/2388 #}
  261. {% from _self import tree %}
  262. <div class="ec-categoryNaviRole">
  263. <div class="ec-itemNav">
  264. <ul class="ec-itemNav__nav">
  265. {% for Category in Categories %}
  266. <li>
  267. {{ tree(Category) }}
  268. </li>
  269. {% endfor %}
  270. </ul>
  271. </div>
  272. </div>
  273. -->
  274. <!-- testend -->
  275.         {% if categoryId == 8 %}
  276.             <!--<ol class="topic-path">
  277.             <li>ALL WINE</li>
  278.             </ol>-->
  279.             <h1 class="wine-list__page-title">WINE LIST</h1>
  280.             <p class="wine-list__area">
  281.             Gamay , Cinsault , Lambrusco , Nebbiolo , Primitivo , Pinot Noir , Gamay , Cinsault , Lambrusco , Nebbiolo , Primitivo , Pinot Noir , Gamay , Cinsault , Lambrusco , Nebbiolo , Primitivo , Pinot Noir , Gamay , Cinsault , Lambrusco , Nebbiolo , Primitivo , Pinot Noir , 
  282.             </p>
  283.             <div class="wine-list__nav-wrap">
  284.             <ul class="wine-list__nav">
  285.             <li><a href="https://wineshop.salond.jp/products/list?category_id=10"><span>赤ワイン</span></a></li>
  286.             <li><a href="https://wineshop.salond.jp/products/list?category_id=13"><span>白ワイン</span></a></li>
  287.             <li><a href="https://wineshop.salond.jp/products/list?category_id=14"><span>スパークリング</span></a></li>
  288.             <li><a href="https://wineshop.salond.jp/products/list?category_id=15"><span>ロゼ</span></a></li>
  289.             <li><a href="https://wineshop.salond.jp/products/list?category_id=16"><span>オレンジ</span></a></li>
  290.             </ul>
  291.             </div>
  292.             <!--<section class="product-recommend">
  293.             <h2 class="product-recommend__title">今月のおすすめ</h2>
  294.             <section id="recommend"></section>
  295.             </section>--><!-- /.product-recommend -->
  296.        {% else %}
  297.         
  298.        {% endif %}
  299.        
  300.             <ul class="product-list">
  301.             {% for Product in Products  %}
  302.                 {% if Product.ProductCategories is not empty %}
  303.                     {% set categoryIds = [] %}
  304.                     {% for ProductCategory in Product.ProductCategories %}
  305.                         {% set categoryIds = categoryIds|merge([ProductCategory.CategoryId]) %}
  306.                     {% endfor %}
  307.                     <li class="type-{{ categoryIds|join(' type-') }}">
  308.                 {% else %}
  309.                     <li>
  310.                 {% endif %}
  311.                     <a href="{{ url('product_detail', {'id': Product.id}) }}">
  312.                         <div class="product-list__pic"><img class="" src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" {% if loop.index > 5 %} loading="lazy"{% endif %}></div>
  313.                         <p class="product-list__title">
  314.                             {{ Product.name }}
  315.                         </p>
  316.                         <span class="product-list__price">
  317.                                     {% if Product.hasProductClass %}
  318.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  319.                                             {{ Product.getPrice02IncTaxMin|price }}
  320.                                         {% else %}
  321.                                             {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  322.                                         {% endif %}
  323.                                     {% else %}
  324.                                         {{ Product.getPrice02IncTaxMin|price }}
  325.                                     {% endif %}
  326.                          <span>(税込み)</span></span>
  327.                     </a>
  328.                 </li>
  329.             {% endfor %}
  330.             <!-- /.product-list-wrap --></ul>
  331.             
  332.         <a href="https://wineshop.salond.jp/products/list" class="btn--show">全ラインナップを見る</a>
  333.         <!-- /.product-container --></div>
  334. {% endblock %}