app/template/default/Block/hsd_related_product42.twig line 1

Open in your IDE?
  1. {% block main %}
  2.     <script>
  3.         $(function () {
  4.             $('#hsd_related_product_area').appendTo($('.related_product_wrap'));
  5.         });
  6.     </script>
  7.     <link rel="stylesheet" href="{{ asset('assets/css/hsd_swiper.min.css') }}">
  8.     <script src="{{ asset('assets/js/hsd_swiper.min.js') }}"></script>
  9.     {#
  10.     <style type="text/css">
  11.         .hsd_product_img_rp {
  12.             width: 100%;
  13.         }
  14.         .hsd_flex_area_rp {
  15.         {% if show_type == 'flip' or show_type == 'cube' %}
  16.             display: block;
  17.         {% else %}
  18.             display: flex;
  19.             flex-wrap: wrap;
  20.         {% endif %}
  21.         }
  22.         
  23.         .hsd_h4 {
  24.             padding-left: 15px;
  25.         }
  26.     </style>
  27.     #}
  28.     <div class="ec-shelfRole" id="hsd_related_product_area">
  29.         {% if rp_count > 0 %}
  30.             {# <h4 class="hsd_h4">{{ title }}</h4> #}
  31.             <h2><span>{{ title }}</span></h2>
  32.         {% endif %}
  33.         {% set lpc = 1 %}
  34.         {% if rp_count > 0 and show_type == 'normal' %}
  35.             <ul class="ec-shelfGrid">
  36.                 {% for reldat in hsd_related_product %}
  37.                     {% if max_count >= lpc %}
  38.                         <li class="ec-shelfGrid__item">
  39.                             <a href="{{ url('product_detail', {'id': reldat.id}) }}">
  40.                                 <p class="item_img">
  41.                                     <img src="{{ asset('', 'save_image') }}{{ reldat.file_name | no_image_product }}" alt="{{reldat.name}}">
  42.                                 </p>
  43.                                 <p class="item_name">{{reldat.name}}</p>
  44.                                 {% if show_price == 'true' %}
  45.                                     {% if reldat.min_price == reldat.max_price %}
  46.                                         {% if calc_rule == 'floor' %}
  47.                                             <p class="item_price">¥{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}</p>
  48.                                         {% elseif calc_rule == 'ceil' %}
  49.                                             <p class="item_price">¥{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}</p>
  50.                                         {% else %}
  51.                                             <p class="item_price">¥{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}</p>
  52.                                         {% endif %}
  53.                                     {% else %}
  54.                                     
  55.                                         {% if calc_rule == 'floor' %}
  56.                                             <p class="item_price price_multiple">¥{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }} ~ ¥{{ (reldat.max_price * reldat.tax2)|round(0, 'floor')|number_format(0, '.', ',') }}</p>
  57.                                         {% elseif calc_rule == 'ceil' %}
  58.                                             <p class="item_price price_multiple">¥{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }} ~ ¥{{ (reldat.max_price * reldat.tax2)|round(0, 'ceil')|number_format(0, '.', ',') }}</p>
  59.                                         {% else %}
  60.                                             <p class="item_price price_multiple">¥{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }} ~ ¥{{ (reldat.max_price * reldat.tax2)|round|number_format(0, '.', ',') }}</p>
  61.                                         {% endif %}
  62.                                         
  63.                                     {% endif %}
  64.                                 {% endif %} 
  65.                             </a>
  66.                         </li>
  67.                     {% endif %}
  68.                     {% set lpc = lpc + 1 %}
  69.                 {% endfor %}
  70.             </ul>
  71.         {% endif %}
  72.                 
  73.         {#
  74.         <div class="hsd_flex_area_rp">
  75.             {% if rp_count > 0 and show_type == 'normal' %}
  76.                 {% for reldat in hsd_related_product %}
  77.                     {% if max_count >= lpc %}
  78.                         <div class="col-sm-3 col-xs-6">
  79.                             <div class="pickup_item">
  80.                                 <a href="{{ url('product_detail', {'id': reldat.id}) }}">
  81.                                     <div class="item_photo"><img src="{{ asset('', 'save_image') }}{{ reldat.file_name | no_image_product }}" class="hsd_product_img_rp" style="width: 100%;" /></div>
  82.                                     <dd class="item_comment">{{ reldat.description_detail|length > 30 ? reldat.description_detail[:30] ~ '...' : reldat.description_detail }}</dd>
  83.                                     <dl>
  84.                                         <dt class="item_name">{{reldat.name}}</dt>
  85.                                         {% if show_price == 'true' %}
  86.                                             {% if reldat.min_price == reldat.max_price %}
  87.                                                 {% if calc_rule == 'floor' %}
  88.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
  89.                                                 {% elseif calc_rule == 'ceil' %}
  90.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
  91.                                                 {% else %}
  92.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円</dd>
  93.                                                 {% endif %}
  94.                                             {% else %}
  95.                                                 {% if calc_rule == 'floor' %}
  96.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
  97.                                                 {% elseif calc_rule == 'ceil' %}
  98.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
  99.                                                 {% else %}
  100.                                                     <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round|number_format(0, '.', ',') }}円</dd>
  101.                                                 {% endif %}
  102.                                             {% endif %}
  103.                                         {% endif %}
  104.                                     </dl>
  105.                                 </a>
  106.                             </div>
  107.                         </div>
  108.                     {% endif %}
  109.                     {% set lpc = lpc + 1 %}
  110.                 {% endfor %}
  111.             {% else %}
  112.                 {%  if rp_count > 0 %}
  113.                     <div class="swiper-container">
  114.                         <div class="swiper-wrapper">
  115.                             {% for reldat in hsd_related_product %}
  116.                                 {% if max_count >= lpc %}
  117.                                     <div class="swiper-slide">
  118.                                         <div class="pickup_item">
  119.                                             <a href="{{ url('product_detail', {'id': reldat.id}) }}">
  120.                                                 <div class="item_photo"><img src="{{ asset('', 'save_image') }}{{ reldat.file_name | no_image_product }}" style="width: 100%;" /></div>
  121.                                                 <dd class="item_comment">{{ reldat.description_detail|length > 30 ? reldat.description_detail[:30] ~ '...' : reldat.description_detail }}</dd>
  122.                                                 <dl>
  123.                                                     <dt class="item_name">{{reldat.name}}</dt>
  124.                                                     {% if show_price == 'true' %}
  125.                                                         {% if reldat.min_price == reldat.max_price %}
  126.                                                             {% if calc_rule == 'floor' %}
  127.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
  128.                                                             {% elseif calc_rule == 'ceil' %}
  129.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
  130.                                                             {% else %}
  131.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円</dd>
  132.                                                             {% endif %}
  133.                                                         {% else %}
  134.                                                             {% if calc_rule == 'floor' %}
  135.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
  136.                                                             {% elseif calc_rule == 'ceil' %}
  137.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
  138.                                                             {% else %}
  139.                                                                 <dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round|number_format(0, '.', ',') }}円</dd>
  140.                                                             {% endif %}
  141.                                                         {% endif %}
  142.                                                     {% endif %}
  143.                                                 </dl>
  144.                                             </a>
  145.                                         </div>
  146.                                     </div>
  147.                                 {% endif %}
  148.                                 {% set lpc = lpc + 1 %}
  149.                             {% endfor %}
  150.                         </div>
  151.                         {% if pagination == 'true' %}
  152.                             <div class="swiper-pagination"></div>
  153.                         {% endif %}
  154.                         {% if navbuttons == 'true' %}
  155.                             <div class="swiper-button-prev"></div>
  156.                             <div class="swiper-button-next"></div>
  157.                         {% endif %}
  158.                     </div>
  159.                 {%  endif %}
  160.             {% endif %}
  161.         </div>
  162.         #}
  163.     </div>
  164.     {#
  165.     {%  if rp_count > 0 %}
  166.         {% if show_type == 'flip' or show_type == 'cube' %}
  167.             <style>
  168.                 #hsd_related_product_area .swiper-container {
  169.                     margin: 0 20px;
  170.                 }
  171.             </style>
  172.         {% elseif show_type == 'coverflow' %}
  173.             <style>
  174.                 #hsd_related_product_area .swiper-slide {
  175.                     background-position: center;
  176.                     background-size: cover;
  177.                     width: 200px;
  178.                 }
  179.             </style>
  180.         {% endif %}
  181.     {% endif %}
  182.     <script>
  183.         var swiper = new Swiper('#hsd_related_product_area .swiper-container', {
  184.             pagination: '#hsd_related_product_area .swiper-pagination',
  185.             prevButton: '#hsd_related_product_area .swiper-button-prev',
  186.             nextButton: '#hsd_related_product_area .swiper-button-next',
  187.             paginationClickable: true,
  188.             {% if rp_count > 0 and showloop == 'true' %}
  189.             autoplay: 2500,
  190.             {% else %}
  191.             autoplay: 0,
  192.             {% endif %}
  193.             {% if rp_count > 0 and show_type == 'per3' %}
  194.             slidesPerView: 3,
  195.             spaceBetween: 20,
  196.             {% elseif rp_count > 0 and show_type == 'per4' %}
  197.             slidesPerView: 4,
  198.             spaceBetween: 20,
  199.             {% elseif rp_count > 0 and show_type == 'per5' %}
  200.             slidesPerView: 5,
  201.             spaceBetween: 20,
  202.             {% elseif rp_count > 0 and show_type == 'flip' %}
  203.             effect: 'flip',
  204.             grabCursor: true,
  205.             {% elseif rp_count > 0 and show_type == 'cube' %}
  206.             effect: 'cube',
  207.             grabCursor: true,
  208.             cube: {
  209.                 shadow: true,
  210.                 slideShadows: true,
  211.                 shadowOffset: 20,
  212.                 shadowScale: 0.94
  213.             },
  214.             {% elseif rp_count > 0 and show_type == 'coverflow' %}
  215.             effect: 'coverflow',
  216.             grabCursor: true,
  217.             centeredSlides: true,
  218.             slidesPerView: 'auto',
  219.             coverflow: {
  220.                 rotate: 50,
  221.                 stretch: 0,
  222.                 depth: 100,
  223.                 modifier: 1,
  224.                 slideShadows : true
  225.             },
  226.             {% endif %}
  227.         });
  228.         {% if rp_count > 0 and showloop == 'false' %}
  229.         swiper.autoplay.stop();
  230.         {% endif %}
  231.     </script>
  232.     #}
  233. {% endblock %}