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

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