function replaceMyCartIconWithTeklifButton() {
document.querySelectorAll('div.mycartIcon.tip').forEach(function(el) {
const urunLinkTag = el.closest('.productItem')?.querySelector('a[href^="/"]');
const urunLink = urunLinkTag ? urunLinkTag.getAttribute('href') : window.location.pathname;
el.innerHTML = '';
const teklifBtn = document.createElement("a");
teklifBtn.href = "#";
teklifBtn.className = "teklif-ver-btn-inline";
teklifBtn.textContent = "Teklif Ver";
teklifBtn.onclick = function (e) {
e.preventDefault();
const adet = prompt("Kaç adet ürün için teklif almak istiyorsunuz?");
if (adet && !isNaN(adet)) {
const mesaj = encodeURIComponent(`Merhaba, aşağıdaki ürün hakkında bilgi almak istiyorum:\n${window.location.origin}${urunLink}\nAdet: ${adet}`);
window.location.href = `https://wa.me/905386237447?text=${mesaj}`;
} else {
alert("Lütfen geçerli bir sayı giriniz.");
}
};
el.appendChild(teklifBtn);
});
}
document.addEventListener("DOMContentLoaded", function() {
replaceMyCartIconWithTeklifButton();
window.addEventListener('scroll', replaceMyCartIconWithTeklifButton);
});
const style = document.createElement('style');
style.innerHTML = `
.teklif-ver-btn-inline {
display: inline-block !important;
width: 130px !important;
height: 48px !important;
background: linear-gradient(45deg, #FF6B00, #FF8E00, #FFC300);
color: #fff !important;
font-weight: 700 !important;
font-size: 18px !important;
font-family: 'Arial Black', Gadget, sans-serif !important;
text-align: center;
line-height: 48px !important;
border-radius: 12px !important;
box-shadow:
0 4px 10px rgba(255, 140, 0, 0.6),
inset 0 -2px 6px rgba(255, 255, 255, 0.3);
cursor: pointer !important;
user-select: none !important;
transition: all 0.3s ease !important;
position: relative;
overflow: hidden;
}
.teklif-ver-btn-inline::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: rgba(255, 255, 255, 0.3);
transform: rotate(25deg);
transition: all 0.5s ease;
pointer-events: none;
}
.teklif-ver-btn-inline:hover::before {
top: 100%;
left: 100%;
}
.teklif-ver-btn-inline:hover {
box-shadow:
0 6px 14px rgba(255, 140, 0, 0.9),
inset 0 -2px 8px rgba(255, 255, 255, 0.5);
transform: scale(1.1);
}
.teklif-ver-btn-inline:active {
transform: scale(0.95);
}
`;
document.head.appendChild(style);
document.addEventListener("DOMContentLoaded", function () {
const urunKoduSpan = document.querySelector(".productcode");
const divStokYok = document.getElementById("divStokYok");
const basketBtnContainer = document.querySelector(".BasketBtn");
const btnHemenAl = document.getElementById("btnHemenAl");
if (urunKoduSpan && urunKoduSpan.innerText.includes("THSY")) {
// divStokYok görünür ve iletişim kodu ekle
if (divStokYok) {
divStokYok.style.display = "block";
const mesaj = `Merhaba, bu ürünle ilgili bilgi almak istiyorum: ${window.location.href}`;
divStokYok.innerHTML += `
İletişim Kodu: ${mesaj}`;
}
// Sepet buton alanını komple kaldır
if (basketBtnContainer) {
basketBtnContainer.remove();
}
// Ayrı yerde ise btnHemenAl butonunu da kaldır
if (btnHemenAl) {
btnHemenAl.remove();
}
}
});
document.addEventListener("DOMContentLoaded", function () {
const urunKoduSpan = document.querySelector(".productcode");
const divStokYok = document.getElementById("divStokYok");
if (urunKoduSpan && urunKoduSpan.innerText.includes("THSY") && divStokYok) {
divStokYok.style.display = "block";
// Sadece mesaj metnini ekleyelim (a tagı yok):
const mesaj = `Merhaba, bu ürünle ilgili bilgi almak istiyorum: ${window.location.href}`;
// #divStokYok içine sadece linkin mesaj kısmını ekleyebilirsin:
divStokYok.innerHTML += `
İletişim Kodu: ${mesaj}`;
}
});
// Lütfen silmeyiniz. Bu sitenizin font scriptidir.
function fncFontInit() {
WebFontConfig = {
google: {
families: ['Montserrat:wght@400,500,600,700']
}
};
(function(d) {
var wf = d.createElement('script'),
s = d.scripts[0];
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
wf.async = true;
s.parentNode.insertBefore(wf, s);
})(document);
}
// Sayfa yüklenince çalışacak işlemler
document.addEventListener("DOMContentLoaded", function () {
// 🔻 BURAYA EKLE
document.querySelectorAll('.whts').forEach(function(el) {
el.remove();
});
});
//Lütfen silmeyiniz. Bu sitewnizin font scriptidir.
function fncFontInit() {
WebFontConfig = {
google: {
families: ['Montserrat:wght@400,500,600,700']
}
};
(function (d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
wf.async = true;
s.parentNode.insertBefore(wf, s);
})(document);
}
fncOptimizeScript(function () { fncFontInit() });
$(document).ready(function() {
$('
`);
// Glow ve hover efektleri
$('