{% set current_path = app.request.get('_route') %}
{% if (current_path == 'top/index' or current_path == 'main-category/index' or current_path == 'item/index' or current_path == 'sub-category/index') %}
<div style="width: 100vw;">
<div class="title-h2">
<h2> 最近閲覧した商品はこちら</h2>
</div>
<div class="recentviews ajax" style="margin-top:10px;">
<div id="recentviews" style="overflow: hidden; margin: 0;">
<div style="margin-left: 0;display:flex;overflow-x:scroll;-webkit-overflow-scrolling: touch;">
{% for item in recentviews %}
<div style="width: 105px; float: left;margin: 0 6px;margin-bottom: 15px;">
<div style="height: 152px;">
<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>
</div>
<div style="margin-top: 5px; font-size: 11px;line-height:1.3em;">
<a href="/item/{{ item.item_id }}.html">{{ item.goods_name }}</a>
</div>
<div style="font-size: 11px; color: #666;">
<span class="recent_item_price">
{{ php_number_format(item.min_gp_price) }}円(税込)</span> ~
{% if item.review > 0 %}
<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>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<script async>
$(function() {
$(".recommend-images").on("load", function(e){
if (this.width > 105) {
$(this).css("height", "auto");
$(this).css("width", "105px");
}
$(this).css({
"padding-top" : (150 - this.height) / 2,
"padding-right" : (105 - this.width) / 2,
"padding-bottom" : (150 - this.height) / 2,
"padding-left" : (105 - this.width) / 2
});
}).each(function() {
if(this.complete || /*for IE 10-*/ $(this).height() > 0)
$(this).load();
});
});
</script>
{% endif %}