閲覧履歴
4
20
large
off
horizontal
off
#202124
#202124
#ffffff
let timerRV = setInterval(function() {
if ($ && $.fn && $.fn.slick) {
try{
mainRV();
clearInterval(timerRV);
}catch(error){
console.error(`timerRV Error: ${error}`);
clearInterval(timerRV);
}
const parentElement = document.querySelector('.spHeaderBrand__detailMenu__news__header__heading');
if (parentElement) {
parentElement.classList.remove('hidden');
}
} else {}
}, 5000);
document.querySelector('#spHeader__topMenu__btn').addEventListener('click', function() {
$('.sidebar-recentlyview.slick-initialized').slick('unslick');
$(".sidebar-recentlyview").not('.slick-initialized').slick({
slidesToShow: 3.5,
slidesToScroll: 1,
arrows: true,
infinite: false,
autoplay: false,
initialSlide: 0
});
});
function mainRV() {
var divParent = document.createElement('div');
divParent.setAttribute('class', 'sidebar-recentlyview-main');
$('.spHeaderBrand__detailMenu__recentlyViewedItems__header').append(divParent);
var divChild = document.createElement('div');
divChild.setAttribute('class', 'sidebar-recentlyview');
$('.sidebar-recentlyview-main').append(divChild);
const sidebarAppend = document.querySelectorAll('.Qe_Recently-view .slick-slide:not(.slick-cloned)');
Array.from(sidebarAppend).forEach((element, index) => {
var eleHtml = element.innerHTML;
$('.sidebar-recentlyview').append(eleHtml);
});
$(".sidebar-recentlyview").not('.slick-initialized').slick({
slidesToShow: 3.5,
slidesToScroll: 1,
arrows: true,
infinite: false,
autoplay: false,
initialSlide: 0
});
$('.recently_sliders.slick-initialized').slick('unslick');
$('.recently_sliders').not('.slick-initialized').slick({
slidesToShow: 4,
infinite: false,
slidesToScroll: 1,
centerMode: false,
arrows: true,
responsive: [{
breakpoint: 750,
settings: {
slidesToShow: 2.5,
arrows: true,
}
}]
});
$('.Qe_Recently-view').addClass('slick-active');
$(".product_price_regular").each(function() {
var salePriceElement = $(this).find('s').next();
var regularPriceElement = $(this).text();
var regularPriceTextArray = regularPriceElement.split(/\s+/);
var salePriceText = regularPriceTextArray[1];
var regularPriceText = regularPriceTextArray[0];
$(this).empty();
var regularPriceNumber = Number(regularPriceText.slice(1).replace(/,/g, ''));
var salePriceNumber = Number(salePriceText.slice(1).replace(/,/g, ''));
var differenceInPrice = regularPriceNumber - salePriceNumber;
var discountPercent = Math.round(differenceInPrice / regularPriceNumber * 100);
var wrapperElement = document.createElement('div');
wrapperElement.setAttribute('class', 'products-card__price');
var priceElement = document.createElement('span');
priceElement.setAttribute('class', 'products-card__price');
if (discountPercent !== 0) {
priceElement.classList.add('onSale');
}
priceElement.innerHTML = salePriceText;
var taxElement = document.createElement('span');
taxElement.setAttribute('class', 'products-card__price__tax');
taxElement.innerHTML = '税込';
if (discountPercent !== 0) {
taxElement.classList.add('onSale');
}
wrapperElement.appendChild(priceElement);
wrapperElement.appendChild(taxElement);
if (discountPercent !== 0) {
var discountElement = document.createElement('span');
discountElement.setAttribute('class', 'products-card__price__discount');
discountElement.innerHTML = discountPercent + '%OFF';
wrapperElement.appendChild(discountElement);