`
} else if (nn.pviTypeName == "Washing Machine") {
htmlSegment += `
`
} else {
htmlSegment += `
`
}
if (nn.cstag === "" || nn.cstag === undefined) {
htmlSegment += `
`
} else {
htmlSegment += `
${nn.cstag}
`
}
if (nn.livestreamingTag === "" || nn.livestreamingTag === undefined) {
htmlSegment += `
`
} else {
htmlSegment += `
${nn.livestreamingTag}
`
}
htmlSegment += `
`
if (nn.pviTypeName == "Mobile") {
htmlSegment += `
Colour: ${CurrentlocalColor}
${colorVarient}
${memorYVarient}
`
} else if (nn.pviTypeName == "Washing Machine") {
htmlSegment += `
Colour: ${CurrentlocalColor}
${colorVarient}
${memorYVarient}
`
} else if (nn.pviTypeName == "Air Conditioner") {
htmlSegment += `
Colour: ${CurrentlocalColor}
`
} else if (nn.pviTypeName == "TV") {
htmlSegment += `
Size: ${CurrentlocalColor}
`
} else {
htmlSegment += `
Colour: ${CurrentlocalColor}
`
}
htmlSegment += `
${priceHtml}
`
htmlSegment += `${bestpriceHTml} `
///best offer k liye
htmlSegment += `${offerTsextHtml} `
htmlSegment += `
${buttoncooection}
`;
}
totalHtml += newhtmlSegment + htmlSegment;
});
html += `
${totalHtml}
`;
if (pi === 0) {
var container = document.querySelector('#has1 .rpannel');
// console.log(container)
container.innerHTML = html;
loadMoreProduct(id="has1")
html = ""
}
else if (pi === 1) {
var container = document.querySelector('#has2 .rpannel');
// console.log(container)
container.innerHTML = html;
loadMoreProduct(id="has2")
html = ""
}
else if (pi === 2) {
var container = document.querySelector('#has3 .rpannel');
//console.log(container)
container.innerHTML = html;
loadMoreProduct(id="has3")
html = ""
}
else if (pi === 3) {
var container = document.querySelector('#has4 .rpannel');
//console.log(container)
container.innerHTML = html;
loadMoreProduct(id="has4")
html = ""
}
}
$('.rpannel .owl-carousel').owlCarousel({
loop: false,
margin: 10,
responsiveClass: true,
responsive: {
0: {
items: 1,
nav: false
},
600: {
items: 2,
nav: false
},
1000: {
items: 4,
nav: true,
loop: false,
margin: 20
}
}
})
$(document).on('change', '.memorytvarient input[type="radio"]', function () {
var $colorMemory = $('.memorytvarient input[type="radio"]');
if ($colorMemory.is(':checked') === true) {
loadCurrentMemory = $(this).val();
CurrentlocalColor = $(this).parents().eq(2).find('.colorvarient input[type="radio"]:checked').attr('data-localcolor')
var fid = $(this).parents().eq(3).attr('data-fid')
positionId = $(this).parents().eq(3).attr('data-position')
loadCurrentColor = $(this).parents().eq(2).find('.colorvarient input[type="radio"]:checked').val();
var selectedObject = productListOuterArray[positionId].find(c => c.familyId == fid)
selectedObject.modelList.forEach((n, index) => {
if( Object.keys(n.fmyChipList).length === 0 ){
return;
}else{
modalListCOlor = `${n.fmyChipList[0].fmyChipCode}`
modalListLocalcolor = `${n.fmyChipList[0].fmyChipLocalName}`
modalListMemory = `${n.fmyChipList[1].fmyChipCode}`
if (loadCurrentColor == modalListCOlor && modalListMemory == loadCurrentMemory && CurrentlocalColor == modalListLocalcolor) {
$(this).parents().eq(3).find('.product-color').html(`Colour:
${CurrentlocalColor}`)
if (n.livestreamingVideoImg === "" || n.livestreamingVideoImg === undefined) {
$(this).parents().eq(3).find('.productimage').html(`
`)
} else{
$(this).parents().eq(3).find('.productimage').html(`
`)
}
if (n.livestreamingTag === "" || n.livestreamingTag === undefined) {
$(this).parents().eq(3).find('.livestremtag').html(``)
} else {
$(this).parents().eq(3).find('.livestremtag').html(`
${n.livestreamingTag}`)
}
if (n.cstag === "" || n.cstag === undefined) {
$(this).parents().eq(3).find('.protag').html(`
`)
} else {
$(this).parents().eq(3).find('.protag').html(`
${n.cstag}`)
}
if (`${n.ctaType}` === 'InStock' && `${n.bestprice}` !== "undefined" && `${n.bestprice}` !== "") {
//$(this).parents().eq(3).find('.bestpricetag').html(`
`)
} else {
//$(this).parents().eq(3).find('.bestpricetag').html(``)
}
if (`${n.storePromotions}` !== "null") {
//$(this).parents().eq(3).find('.offertextapi').html(`
${n.storePromotions[0].promotionText}`)
} else {
// $(this).parents().eq(3).find('.offertextapi').html(``)
}
if(n.promotionPrice != null ){
myperdis = Math.round(`${((1 - (n.promotionPrice) / (n.price)) * 100)}`);
}
if (n.ctaEngText == "Buy now" && n.ctaType == "learnMore") {
if (`${n.promotionPriceDisplay}` != 'null') {
var colorchangePrice = `${(n.price) - (n.promotionPrice)}`
if (colorchangePrice >= 0) {
colorchangePrice = `
₹ ${n.promotionPrice}.00 ₹ ${n.price}
${myperdis}% OFF
${n.priceDisplay}
Save ₹ ${(n.price) - (n.promotionPrice)}.00 `
} else {
colorchangePrice = ``
}
$(this).parents().eq(3).find('.pricerange').html(`${colorchangePrice} `)
} else {
$(this).parents().eq(3).find('.offertextprice').html(` `)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
if (n.pviTypeName == "Washing Machine") {
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
else if(n.pviTypeName == "Mobile" && n.pviSubtypeName == "Smartphone"){
if(n.configuratorUseYn === "Y"){
$(this).parents().eq(3).find('.button-collection').html(`
`)
}else{
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
}
else {
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
}
else if (`${n.ctaType}` == 'InStock') {
if (`${n.promotionPriceDisplay}` != 'null') {
var colorchangePrice = `${(n.price) - (n.promotionPrice)}`
if (colorchangePrice >= 0) {
colorchangePrice = `
₹ ${n.promotionPrice}.00 ₹ ${n.price}
${myperdis}% OFF
${n.priceDisplay}
Save ₹ ${(n.price) - (n.promotionPrice)}.00 `
} else {
colorchangePrice = ``
}
$(this).parents().eq(3).find('.pricerange').html(`${colorchangePrice} `)
} else {
$(this).parents().eq(3).find('.offertextprice').html(` `)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
if (n.pviTypeName == "Washing Machine") {
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
else if(n.pviTypeName == "Mobile" && n.pviSubtypeName == "Smartphone"){
if(n.configuratorUseYn === "Y"){
$(this).parents().eq(3).find('.button-collection').html(`
`)
}else{
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
}
else {
$(this).parents().eq(3).find('.button-collection').html(`
`)
}
}
else if(`${n.ctaType}` == 'learnMore' && `${n.ctaLocalText}` == 'Buy now'){
if(`${n.configuratorUseYn}` === 'Y'){
$(this).parents().eq(3).find('.button-collection').html(`
`)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
else if( `${n.configuratorUseYn}` === 'N'){
$(this).parents().eq(3).find('.button-collection').html(`
`)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
else{
$(this).parents().eq(3).find('.button-collection').html(`
`)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
}
else {
$(this).parents().eq(3).find('.button-collection').html(`
`)
$(this).parents().eq(3).find('.pricerange').html(`
`)
}
}
}
})
}
});
colorChange()
}
renderProducts()
})
$("a[href^='#']").click(function(e) {
e.preventDefault();
var position = $($(this).attr("href")).offset().top - 50;
$("body, html").animate({
scrollTop: position
} /* speed */ );
});
});