| Server IP : 103.48.194.25 / Your IP : 216.73.216.74 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hocthongminh.net-bk/public_html/site/components/khuyenmai/views/ |
Upload File : |
<div id="seen-products" class="seen-products-slider">
<div class="home-section-head clearfix">
<div class="section-title">
<h2> Sản phẩm đã xem </h2>
</div>
</div>
<div class="home-section-body">
<div class="show">
<div class="product-seen grid mg-left-0">
<div id="owl-spdx" class="owl-carousel new-slide owl-loaded owl-drag">
<div class="owl-stage-outer">
<div class="owl-stage" style="transform: translate3d(0px, 0px, 0px); transition: all 0s ease 0s; width: 720px;">
<div class="owl-item active" style="width: 240px;">
<div class="grid__item item pd-left0">
<div class="seen-item">
<div class="product-item">
<div class="product-img"> <a href="/products/dien-thoai-apple-iphone-7-plus-den-xam-vang-64gb-128gb-256gb"> <img src="//product.hstatic.net/1000253476/product/suplo-004a-011_medium.jpg" alt=""> </a> </div>
<div class="product-item-info">
<div class="product-title"> <a href="/products/dien-thoai-apple-iphone-7-plus-den-xam-vang-64gb-128gb-256gb">Điện thoại Apple iPhone 7 Plus (Đen xám/Vàng ...</a> </div>
<div class="product-price clearfix"> <span class="current-price">19,990,000₫</span> <span class="original-price"></span> </div>
</div>
</div>
</div>
</div>
</div>
<div class="owl-item active" style="width: 240px;">
<div class="grid__item item pd-left0">
<div class="seen-item">
<div class="product-item">
<div class="product-img"> <a href="/products/may-tinh-bang-huawei-mediapad-m3-8-0-vang-xam-32gb"> <img src="//product.hstatic.net/1000253476/product/suplo-027b-011_medium.jpg" alt=""> </a> </div>
<div class="product-item-info">
<div class="product-title"> <a href="/products/may-tinh-bang-huawei-mediapad-m3-8-0-vang-xam-32gb">Máy tính bảng Huawei MediaPad M3 8.0 (Vàng/Xá...</a> </div>
<div class="product-price clearfix"> <span class="current-price">5,990,000₫</span> <span class="original-price"></span> </div>
</div>
</div>
</div>
</div>
</div>
<div class="owl-item active" style="width: 240px;">
<div class="grid__item item pd-left0">
<div class="seen-item">
<div class="product-item">
<div class="product-img"> <a href="/products/phu-kien-apple-cap-ket-noi-lightning-to-usb-cable"> <img src="//product.hstatic.net/1000253476/product/suplo-033a-01_medium.jpg" alt=""> </a> </div>
<div class="product-item-info">
<div class="product-title"> <a href="/products/phu-kien-apple-cap-ket-noi-lightning-to-usb-cable">Phụ kiện Apple Cáp kết nối Lightning to USB C...</a> </div>
<div class="product-price clearfix"> <span class="current-price">499,000₫</span> <span class="original-price"></span> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="owl-nav disabled">
<div class="owl-prev disabled"><svg class="svg-inline--fa fa-angle-left fa-w-8" aria-hidden="true" data-prefix="fa" data-icon="angle-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg="">
<path fill="currentColor" d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"></path>
</svg><!-- <i class="fa fa-angle-left" aria-hidden="true"></i> --></div>
<div class="owl-next disabled"><svg class="svg-inline--fa fa-angle-right fa-w-8" aria-hidden="true" data-prefix="fa" data-icon="angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg="">
<path fill="currentColor" d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path>
</svg><!-- <i class="fa fa-angle-right" aria-hidden="true"></i> --></div>
</div>
<div class="owl-dots disabled"></div>
</div>
<div id="clone-item">
<div class="grid__item item pd-left0 hide">
<div class="seen-item">
<div class="product-item">
<div class="product-img"> <a href="/collections/phu-kien"> <img src="//hstatic.net/0/0/global/noDefaultImage6_medium.gif" alt=""> </a>
<div class="tag-saleoff text-center"> -<span></span>% </div>
</div>
<div class="product-item-info">
<div class="product-title"> <a href=""></a> </div>
<div class="product-price clearfix"> <span class="current-price">0₫</span> <span class="original-price"></span> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var product_handle = 'phu-kien-apple-cap-ket-noi-lightning-to-usb-cable';
var last_view_products_current = localStorage.getItem('last_view_products');
var max_last_view_products = 20;
if( ! last_view_products_current ) {
last_view_products_current = [];
} else {
last_view_products_current = JSON.parse(last_view_products_current);
}
if( last_view_products_current.indexOf(product_handle) == -1 ) {
if( last_view_products_current.length >= max_last_view_products ) {
last_view_products_current.shift();
}
last_view_products_current.push( product_handle );
localStorage.setItem('last_view_products', JSON.stringify(last_view_products_current));
}else{
var remove_at = last_view_products_current.indexOf(product_handle);
last_view_products_current.splice(remove_at, 1);
last_view_products_current.push(product_handle);
if( last_view_products_current.length >= max_last_view_products ) {
last_view_products_current.shift();
}
}
</script>
<script>
$(document).ready(function() {
var last_view_products = JSON.parse(localStorage.getItem('last_view_products'));
if( ! last_view_products ) {
$(document).ready(function() {
$('.product-viewed').hide();
});
last_view_products = [];
return;
}
var display = 10;
var display_items = last_view_products.length < display ? last_view_products.length : display;
var item_idx = 1;
while( item_idx <= display_items ) {
var handle = last_view_products[last_view_products.length - item_idx];
Haravan.getProduct( handle, function( product ) {
var item_product = $('#clone-item .item').clone().removeClass('hide').appendTo('#owl-spdx');
var tag_saleoff = (product.compare_at_price - product.price) / product.compare_at_price * 100;
var item_product_title;
if(product.title.length > 45){
var item_product_title = product.title.substring(0, 45) + '...';
} else {
var item_product_title = product.title;
}
item_product.find('.seen-item .product-item-info .product-title > a').html(item_product_title);
item_product.find('.seen-item .product-img > a > img').attr('src',Haravan.resizeImage(product.featured_image, 'medium'));
item_product.find('.seen-item .product-item-info .product-title > a').attr('href', product.url);
item_product.find('.seen-item .product-img > a').attr('href', product.url);
item_product.find('.seen-item .product-item-info .current-price').html(Haravan.formatMoney(product.price,"{{amount}}₫" ));
item_product.find('.seen-item .product-item-info .original-price > s').html(Haravan.formatMoney(product.compare_at_price,"{{amount}}₫" ));
item_product.find('.seen-item .product-img .tag-saleoff > span').html(Math.round(tag_saleoff));
});
item_idx++;
}
setTimeout(function() {
var owl_1 = $("#owl-spdx").owlCarousel({
smartSpeed: 1000,
nav: true,
dots: false,
loop: false,
autoplay: false,
autoplayHoverPause: true,
responsiveRefreshRate : 200,
navText: ['<i class="fa fa-angle-left" aria-hidden="true"></i>', '<i class="fa fa-angle-right" aria-hidden="true"></i>'],
responsive:{
0:{
items:2
},
480:{
items:3
},
768:{
items:4
},
1000:{
items:5
}
}
});
$('.seen-item .original-price s').each(function() {
var val = parseInt($(this).html());
if(val == 0) {
$(this).remove();
}
});
$('.seen-item .product-img .tag-saleoff').each(function() {
var val = $( "span", this ).html();
if(val == '-Infinity') {
$(this).remove();
}
});
}, 2000);
});
</script>