Brand: Spare Parts
, SIN: 2SP
Automobile Spare Part
Available
Price: CAD $110.00
Test description
- Pump Type: Centrifugal Mondset Pump
- Flow Rate: 1100
- Temperature: 240
- Viscosity: 1100
- Validity: 2027
function toggleFavorite(productId) {
fetch('https://www.emaarenergy.ca/favorites/toggle', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content
},
body: JSON.stringify({ product_id: productId })
})
.then(res => res.json())
.then(data => {
const text = document.getElementById('fav-text-' + productId);
if (data.status === 'added') {
text.innerText = 'Remove from Favorite';
} else {
text.innerText = 'Add to Favorite';
}
const badge = document.querySelector('.fa-regular.fa-heart')?.closest('a')?.querySelector('.notify-dot');
if (badge && data.count !== undefined) {
badge.innerText = data.count;
}
});
}