app/template/default/Block/Sp/Top/lm_content_latest_products.twig line 1

Open in your IDE?
  1. {% set current_path = app.request.get('_route') %}
  2. {% if (current_path == 'top/index' or current_path == 'main-category/index' or current_path == 'item/index' or current_path == 'sub-category/index') %}
  3.   <div style="width: 100vw;">
  4.     <div class="title-h2">
  5.       <h2>&nbsp;最近閲覧した商品はこちら</h2>
  6.     </div>
  7.     <div class="recentviews ajax" style="margin-top:10px;">
  8.       <div id="recentviews" style="overflow: hidden; margin: 0;">
  9.         <div style="margin-left: 0;display:flex;overflow-x:scroll;-webkit-overflow-scrolling: touch;">
  10.           {% for item in recentviews %}
  11.             <div style="width: 105px; float: left;margin: 0 6px;margin-bottom: 15px;">
  12.               <div style="height: 152px;">
  13.                 <a href="/item/{{ item.item_id }}.html"><img class="recommend-images" style="height: auto; display: inline-block; border: 1px solid rgb(204, 204, 204); padding: 0px; width: 105px;" src="{{ makeImageURL("goods.img", item.id) }}" border="0" name="" alt="{{ item.goods_name }}"></a>
  14.               </div>
  15.               <div style="margin-top: 5px; font-size: 11px;line-height:1.3em;">
  16.                 <a href="/item/{{ item.item_id }}.html">{{ item.goods_name }}</a>
  17.               </div>
  18.               <div style="font-size: 11px; color: #666;">
  19.                 <span class="recent_item_price">
  20.                   {{ php_number_format(item.min_gp_price) }}円(税込)</span> ~
  21.                   {% if item.review > 0 %}
  22.                     <div class="recommend-average">{{ item.average_img }}<span class="recommend-average-bracket">(</span><span class="recommend-average-point">{{ php_number_format(item.review) }}</span><span class="recommend-average-bracket">)</span></div>
  23.                   {% endif %}
  24.               </div>
  25.             </div>
  26.           {% endfor %}
  27.         </div>
  28.       </div>
  29.     </div>
  30.   </div>
  31.   <script async>
  32.   $(function() {
  33.     $(".recommend-images").on("load", function(e){
  34.       if (this.width > 105) {
  35.         $(this).css("height", "auto");
  36.         $(this).css("width", "105px");
  37.       }
  38.       $(this).css({
  39.         "padding-top" : (150 - this.height) / 2,
  40.         "padding-right" : (105 - this.width) / 2,
  41.         "padding-bottom" : (150 - this.height) / 2,
  42.         "padding-left" : (105 - this.width) / 2
  43.       });
  44.     }).each(function() {
  45.       if(this.complete || /*for IE 10-*/ $(this).height() > 0)
  46.         $(this).load();
  47.     });
  48.   });
  49.   </script>
  50. {% endif %}