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

Open in your IDE?
  1. {#
  2. This file is part of RecentlyViewedProducts Plugin
  3. Copyright (C) 2023 Diezon.
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% block stylesheet %}
  8.     <style>
  9.     .ec-historyRole {
  10.         padding: 40px 0;
  11.     }
  12.     .ec-historyRole__list {
  13.         list-style-type: none;
  14.         padding-left: 0;
  15.         display: flex;
  16.         flex-wrap: nowrap;
  17.         gap: 8px;
  18.         overflow-x: scroll;
  19.         white-space: nowrap;
  20.         width: 100%;
  21.     }
  22.     .ec-historyRole__list::-webkit-scrollbar {
  23.         display: none;
  24.     }
  25.     .ec-historyRole__listItem {
  26.         max-width: 107px;
  27.         min-width: 107px;
  28.     }
  29.     .ec-historyRole__listImage {
  30.         aspect-ratio: 1/1;
  31.     }
  32.     .ec-historyRole__listImage img {
  33.         width: 100%;
  34.         height: 100%;
  35.         object-position: center;
  36.         object-fit: contain;
  37.     }
  38.     .ec-historyRole__listItemTitle, .ec-historyRole__listItemPrice {
  39.         font-size: 10px;
  40.         color: #000;
  41.         margin-top: 8px;
  42.         line-height: 1.2;
  43.         white-space: initial;
  44.     }
  45.     .ec-historyRole__heading {
  46.         display: flex;
  47.         justify-content: flex-end;
  48.         align-items: center;
  49.         margin-bottom: 15px;
  50.     }
  51.     .ec-historyRole__heading .ec-secHeading {
  52.         margin-bottom: 0;
  53.     }
  54.     .ec-historyRole__linkText {
  55.         font-size: 10px;
  56.     }
  57.     @media only screen and (max-width: 767px) {
  58.         .ec-historyRole__heading .ec-secHeading__line {
  59.             margin: 0 10px;
  60.         }
  61.     }
  62.     @media only screen and (min-width: 768px){
  63.         .ec-historyRole {
  64.             padding: 60px 0;
  65.         }
  66.         .ec-historyRole__list {
  67.             gap: 16px;
  68.         }
  69.         .ec-historyRole__listItem {
  70.             max-width: 128px;
  71.             min-width: 128px;
  72.         }
  73.         .ec-historyRole__listItemTitle, .ec-historyRole__linkText {
  74.             font-size: 12px;
  75.         }
  76.     }
  77.     </style>
  78. {% endblock %}
  79. {% if RecentlyViewedProducts|length > 0 %}
  80. <div class="ec-role">
  81.     <div class="ec-historyRole">
  82.         <div class="ec-historyRole__heading">
  83.             {#<div class="ec-secHeading">#}
  84.             {#    <span class="ec-secHeading__en">{{ 'recently_viewed_products.title.en'|trans }}</span>#}
  85.             {#    <span class="ec-secHeading__line"></span>#}
  86.             {#    <span class="ec-secHeading__ja">{{ 'recently_viewed_products.title.jp'|trans }}</span>#}
  87.             {#</div>#}
  88.             <a href="{{ url('block_recently_viewed_products_clear') }}" class="ec-historyRole__linkText">{{ 'recently_viewed_products.clear'|trans }}</a>
  89.         </div>
  90.         <div class="content-2">
  91.             {% for Product in RecentlyViewedProducts %}
  92.             <div class="card-2">
  93.                 {% for ProductTags in Product.ProductTag %}
  94.                     {% if ProductTags.Tag.id == 1 %}
  95.                         <div class="new">
  96.                             <div class="new-text">New</div>
  97.                         </div>
  98.                     {% endif %}
  99.                 {% endfor %}
  100.                 <a href="{{ url('product_detail', {id: Product.id}) }}">
  101.                     <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" class="" alt="{{ Product.name }}"/>
  102.                 </a>
  103.                 <h3>タイトル:{{ Product.name }}</h3>
  104.                 <p>著者:<span>{{ Product.author }}</span></p>
  105.                 <p>¥<span>{{ Product.getPrice02IncTaxMax }}</span>税込</p>
  106.             </div>
  107.             {% endfor %}
  108.         </div>
  109.     </div>
  110. </div>
  111. {% endif %}