Boutique Officielle Certifiée
DELICIA BY SAFA
pâtisserie
Sfax
7 Références
4.9 Score de Confiance
À Propos de Nous
Navigation Rayons
Collection Exclusive
Découvrez notre sélection rigoureuse de produits.
Trier par :
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "SKU-6MUHJX";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0642\u0637\u0627\u064a\u0641 \u0628\u0627\u0644\u0642\u0634\u0637\u0629"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/ktayf-balksht-69b7f48fa3af5",
name: "\u0642\u0637\u0627\u064a\u0641 \u0628\u0627\u0644\u0642\u0634\u0637\u0629",
summary: "\u0644\u0627 \u064a\u0643\u062a\u0645\u0644 \u0645\u0630\u0627\u0642 \u0631\u0645\u0636\u0627\u0646 \u0628\u062f\u0648\u0646 \u0627\u0644\u0642\u0637\u0627\u064a\u0641 \u0627\u0644\u0634\u0627\u0645\u064a\u0629 \u0627\u0644\u0645\u062d\u0634\u0648\u0629 \u0628\u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u063a\u0646\u064a\u0629. \u0639\u062c\u064a\u0646\u0629 \u0630\u0647\u0628\u064a\u0629 \u0637\u0631\u064a\u0629\u060c \u0645\u062d\u0634\u0648\u0629 \u0628\u062e\u0644\u0637\u062a\u0646\u0627 \u0627\u0644\u062e\u0627\u0635\u0629 \u0645\u0646 \u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u0637\u0627\u0632\u062c\u0629 \u0627\u0644\u0645\u0646\u0643\u0647\u0629 \u0628\u0645\u0627\u0621 \u0627\u0644\u0632\u0647\u0631\u060c \u062c\u0627\u0647\u0632\u0629 \u0644\u062a\u0632\u064a\u064a\u0646 \u0645\u0627\u0626\u062f\u062a\u0643 \u0648\u0625\u0628\u0647\u0627\u0631 \u0636\u064a\u0648\u0641\u0643 \u0628\u0645\u0630\u0627\u0642\u0647\u0627 \u0627\u0644\u0623\u0635\u064a\u0644 \u0627\u0644\u0630\u064a \u064a\u0630\u0648\u0628 \u0641\u064a \u0627\u0644\u0641\u0645.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/lCJ4CAie-1776332202.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/lCJ4CAie-1776332202.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "0,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D9%82%D8%B7%D8%A7%D9%8A%D9%81+%D8%A8%D8%A7%D9%84%D9%82%D8%B4%D8%B7%D8%A9",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/lCJ4CAie-1776332202.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0642\u0637\u0627\u064a\u0641 \u0628\u0627\u0644\u0642\u0634\u0637\u0629",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
قطايف بالقشطة
Sur Devis
0,000
TND
/ pièce
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "SKU-7KVPW5";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0645\u0634\u0628\u0643 \u0633\u0648\u0631\u064a \u0623\u0635\u0644\u064a"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/mshbk-sory-asly-69b7f3d1255dc",
name: "\u0645\u0634\u0628\u0643 \u0633\u0648\u0631\u064a \u0623\u0635\u0644\u064a",
summary: "\u0627\u0633\u062a\u0645\u062a\u0639 \u0628\u062a\u062c\u0631\u0628\u0629 \u0634\u0627\u0645\u064a\u0629 \u0623\u0635\u064a\u0644\u0629 \u0645\u0639 \u0627\u0644\u0645\u0634\u0628\u0643 \u0627\u0644\u0633\u0648\u0631\u064a \u0627\u0644\u0630\u0647\u0628\u064a. \u062f\u0648\u0627\u0626\u0631 \u0645\u0642\u0631\u0645\u0634\u0629 \u0645\u0646 \u0627\u0644\u062e\u0627\u0631\u062c\u060c \u063a\u0646\u064a\u0629 \u0628\u0627\u0644\u0642\u0637\u0631 (\u0627\u0644\u0634\u064a\u0631\u0629) \u0645\u0646 \u0627\u0644\u062f\u0627\u062e\u0644\u060c \u0645\u062d\u0636\u0631\u0629 \u064a\u062f\u0648\u064a\u0627\u064b \u0639\u0644\u0649 \u0627\u0644\u0637\u0631\u064a\u0642\u0629 \u0627\u0644\u062a\u0642\u0644\u064a\u062f\u064a\u0629 \u0644\u0636\u0645\u0627\u0646 \u0627\u0644\u0642\u0631\u0645\u0634\u0629 \u0627\u0644\u0645\u062b\u0627\u0644\u064a\u0629 \u0641\u064a \u0643\u0644 \u0642\u0636\u0645\u0629.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/4PRDgPOX-1776332202.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/4PRDgPOX-1776332202.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "0,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D9%85%D8%B4%D8%A8%D9%83+%D8%B3%D9%88%D8%B1%D9%8A+%D8%A3%D8%B5%D9%84%D9%8A",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/4PRDgPOX-1776332202.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0645\u0634\u0628\u0643 \u0633\u0648\u0631\u064a \u0623\u0635\u0644\u064a",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
مشبك سوري أصلي
Sur Devis
0,000
TND
/ pièce
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "VND-WOCEFB7Q";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0643\u0646\u0627\u0641\u0629 \u0646\u0627\u0628\u0644\u0633\u064a\u0629 \u0628\u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u0641\u0627\u062e\u0631\u0629 - \u0645\u0644\u0643\u0629 \u0627\u0644\u062d\u0644\u0648\u064a\u0627\u062a \u0627\u0644\u0634\u0631\u0642\u064a\u0629"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/knaf-nablsy-balksht-alfakhr-mlk-alhloyat-alshrky-Rcxjr1",
name: "\u0643\u0646\u0627\u0641\u0629 \u0646\u0627\u0628\u0644\u0633\u064a\u0629 \u0628\u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u0641\u0627\u062e\u0631\u0629 - \u0645\u0644\u0643\u0629 \u0627\u0644\u062d\u0644\u0648\u064a\u0627\u062a \u0627\u0644\u0634\u0631\u0642\u064a\u0629",
summary: "\u0627\u0633\u062a\u0645\u062a\u0639 \u0628\u062a\u0646\u0627\u063a\u0645 \u0627\u0644\u0637\u0639\u0645 \u0627\u0644\u0623\u0635\u064a\u0644 \u0645\u0639 \u0627\u0644\u0643\u0646\u0627\u0641\u0629 \u0627\u0644\u0630\u0647\u0628\u064a\u0629 \u0627\u0644\u0645\u0642\u0631\u0645\u0634\u0629 \u0648\u0627\u0644\u0645\u062d\u0634\u0648\u0629 \u0628\u0637\u0628\u0642\u0629 \u063a\u0646\u064a\u0629 \u0645\u0646 \u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u0637\u0627\u0632\u062c\u0629. \u0645\u063a\u0637\u0627\u0629 \u0628\u0631\u0634\u0629 \u0645\u0646 \u0627\u0644\u0641\u0633\u062a\u0642 \u0627\u0644\u062d\u0644\u0628\u064a \u0648\u0627\u0644\u0642\u0637\u0631 \u0627\u0644\u0639\u0637\u0631\u064a \u0644\u062a\u0645\u0646\u062d\u0643 \u062a\u062c\u0631\u0628\u0629 \u062a\u0630\u0648\u0628 \u0641\u064a \u0627\u0644\u0641\u0645 \u0645\u0639 \u0643\u0644 \u0642\u0637\u0639\u0629.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/ImISqiSk-1776332196.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/ImISqiSk-1776332196.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "4,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D9%83%D9%86%D8%A7%D9%81%D8%A9+%D9%86%D8%A7%D8%A8%D9%84%D8%B3%D9%8A%D8%A9+%D8%A8%D8%A7%D9%84%D9%82%D8%B4%D8%B7%D8%A9+%D8%A7%D9%84%D9%81%D8%A7%D8%AE%D8%B1%D8%A9+-+%D9%85%D9%84%D9%83%D8%A9+%D8%A7%D9%84%D8%AD%D9%84%D9%88%D9%8A%D8%A7%D8%AA+%D8%A7%D9%84%D8%B4%D8%B1%D9%82%D9%8A%D8%A9",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/ImISqiSk-1776332196.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0643\u0646\u0627\u0641\u0629 \u0646\u0627\u0628\u0644\u0633\u064a\u0629 \u0628\u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u0641\u0627\u062e\u0631\u0629 - \u0645\u0644\u0643\u0629 \u0627\u0644\u062d\u0644\u0648\u064a\u0627\u062a \u0627\u0644\u0634\u0631\u0642\u064a\u0629",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
-10%
كنافة نابلسية بالقشطة الفاخرة - ملكة الحلويات الشرقية
Sur Devis
4,000
TND
/ pièce
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "VND-7GNMXW54";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0623\u0635\u0627\u0628\u0639 \u0628\u0642\u0644\u0627\u0648\u0629 \u0645\u0644\u0643\u064a\u0629 \u0628\u0627\u0644\u0644\u0648\u0632 \u0627\u0644\u0645\u0642\u0631\u0645\u0634"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/asabaa-bklao-mlky-balloz-almkrmsh-dhGm37",
name: "\u0623\u0635\u0627\u0628\u0639 \u0628\u0642\u0644\u0627\u0648\u0629 \u0645\u0644\u0643\u064a\u0629 \u0628\u0627\u0644\u0644\u0648\u0632 \u0627\u0644\u0645\u0642\u0631\u0645\u0634",
summary: "\u0645\u0632\u064a\u062c \u0633\u0627\u062d\u0631 \u0628\u064a\u0646 \u062e\u0641\u0629 \u0627\u0644\u0639\u062c\u064a\u0646 \u0627\u0644\u0645\u0648\u0631\u0642 \u0648\u063a\u0646\u0649 \u0627\u0644\u0644\u0648\u0632 \u0627\u0644\u0645\u062d\u0645\u0635. \u0623\u0635\u0627\u0628\u0639 \u0627\u0644\u0628\u0642\u0644\u0627\u0648\u0629 \u0627\u0644\u0630\u0647\u0628\u064a\u0629 \u0627\u0644\u0645\u062d\u0634\u0648\u0629 \u0628\u0623\u062c\u0648\u062f \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0644\u0648\u0632\u060c \u0645\u0635\u0645\u0645\u0629 \u0644\u062a\u0643\u0648\u0646 \u0627\u0644\u0642\u0637\u0639\u0629 \u0627\u0644\u0645\u062b\u0627\u0644\u064a\u0629 \u0644\u0636\u064a\u0627\u0641\u0629 \u0631\u0627\u0642\u064a\u0629 \u0648\u0645\u0630\u0627\u0642 \u0644\u0627 \u064a\u064f\u0646\u0633\u0649 \u0641\u064a \u0643\u0644 \u0648\u0642\u062a.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/RTWo5U1x-1776332196.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/RTWo5U1x-1776332196.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "40,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D8%A3%D8%B5%D8%A7%D8%A8%D8%B9+%D8%A8%D9%82%D9%84%D8%A7%D9%88%D8%A9+%D9%85%D9%84%D9%83%D9%8A%D8%A9+%D8%A8%D8%A7%D9%84%D9%84%D9%88%D8%B2+%D8%A7%D9%84%D9%85%D9%82%D8%B1%D9%85%D8%B4",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/RTWo5U1x-1776332196.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0623\u0635\u0627\u0628\u0639 \u0628\u0642\u0644\u0627\u0648\u0629 \u0645\u0644\u0643\u064a\u0629 \u0628\u0627\u0644\u0644\u0648\u0632 \u0627\u0644\u0645\u0642\u0631\u0645\u0634",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
-10%
أصابع بقلاوة ملكية باللوز المقرمش
Sur Devis
40,000
TND
/ pièce
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "VND-LZXR37QP";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0648\u0631\u0628\u0627\u062a \u0641\u0633\u062a\u0642 \u0645\u0644\u0643\u064a\u0629"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/orbat-fstk-mlky-DsAYlp",
name: "\u0648\u0631\u0628\u0627\u062a \u0641\u0633\u062a\u0642 \u0645\u0644\u0643\u064a\u0629",
summary: "\u0627\u0643\u062a\u0634\u0641 \u0633\u0631 \u0627\u0644\u0633\u0639\u0627\u062f\u0629 \u0641\u064a \u0643\u0644 \u0642\u0636\u0645\u0629 \u0645\u0639 \u0627\u0644\u0648\u0631\u0628\u0627\u062a \u0627\u0644\u0633\u0648\u0631\u064a\u0629 \u0627\u0644\u062a\u0642\u0644\u064a\u062f\u064a\u0629. \u0637\u0628\u0642\u0627\u062a \u0630\u0647\u0628\u064a\u0629 \u0641\u0627\u0626\u0642\u0629 \u0627\u0644\u0647\u0634\u0627\u0634\u0629 \u0645\u062d\u0634\u0648\u0629 \u0628\u0627\u0644\u0642\u0634\u0637\u0629 \u0627\u0644\u063a\u0646\u064a\u0629 \u0623\u0648 \u0627\u0644\u0641\u0633\u062a\u0642 \u0627\u0644\u062d\u0644\u0628\u064a\u060c \u0648\u0645\u0632\u064a\u0646\u0629 \u0628\u0644\u0645\u0633\u0629 \u0645\u0646 \u0627\u0644\u0641\u0633\u062a\u0642 \u0627\u0644\u0623\u062e\u0636\u0631. \u0627\u0644\u062d\u0644\u0648\u064a\u0627\u062a \u0627\u0644\u0645\u062b\u0627\u0644\u064a\u0629 \u0644\u062c\u0645\u0639\u0627\u062a\u0643\u0645 \u0648\u0645\u0646\u0627\u0633\u0628\u0627\u062a\u0643\u0645 \u0627\u0644\u0633\u0639\u064a\u062f\u0629.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/kaJwcGAK-1776332196.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/kaJwcGAK-1776332196.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "1,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D9%88%D8%B1%D8%A8%D8%A7%D8%AA+%D9%81%D8%B3%D8%AA%D9%82+%D9%85%D9%84%D9%83%D9%8A%D8%A9",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/kaJwcGAK-1776332196.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0648\u0631\u0628\u0627\u062a \u0641\u0633\u062a\u0642 \u0645\u0644\u0643\u064a\u0629",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
-10%
وربات فستق ملكية
Sur Devis
1,000
TND
/ pièce
0 && this.currentStock <= 5; },
get shouldForceQuote() { return this.isQuoteMode || (this.isService && this.currentPrice <= 0); },
get displaySku() {
return (this.selectedVariant && this.selectedVariant.sku) ? this.selectedVariant.sku : "VND-R59H8WGU";
},
get activeVariantLabel() {
if (!this.selectedVariant) return '';
return this.selectedVariant.label || this.selectedVariant.name || '';
},
init() {
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
this.inWishlist = wl.includes(this.id);
}
window.addEventListener('wishlist-updated', (e) => {
if (e.detail.product_id === this.id) {
this.inWishlist = e.detail.added;
}
});
},
get currentPrice() {
let p = this.selectedVariant ? parseFloat(this.selectedVariant.price) : this.basePrice;
return p > 0 ? p : this.basePrice;
},
formatPrice(p) { return Number(p).toLocaleString('fr-TN', { minimumFractionDigits: 3, maximumFractionDigits: 3, useGrouping: false }); },
handleCardNavigation(event) {
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
if (typeof window.smartTrack === 'function') {
window.smartTrack(this.isService ? 'service_click' : 'product_click', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0628\u0642\u0644\u0627\u0648\u0629 \u062a\u0631\u0643\u064a\u0629 \u0628\u0627\u0644\u0641\u0633\u062a\u0642"
});
}
this.openQuickView();
},
openQuickView() {
const activeGallery = this.galleryImages && this.galleryImages.length ? this.galleryImages : [this.activeImage].filter(Boolean);
const mappedVariants = (this.variants || []).map(v => ({
...v,
price_formatted: this.formatPrice(v.price || 0)
}));
window.dispatchEvent(new CustomEvent('open-product-quickview', {
detail: {
id: this.id,
url: "https:\/\/tamssmall.tn\/catalogue\/produit\/bklao-trky-balfstk-r6Or3J",
name: "\u0628\u0642\u0644\u0627\u0648\u0629 \u062a\u0631\u0643\u064a\u0629 \u0628\u0627\u0644\u0641\u0633\u062a\u0642",
summary: "\u062a\u0630\u0648\u0642 \u0627\u0644\u0623\u0635\u0627\u0644\u0629 \u0627\u0644\u062a\u0631\u0643\u064a\u0629 \u0645\u0639 \u0628\u0642\u0644\u0627\u0648\u0629 \u0627\u0644\u0641\u0633\u062a\u0642 \u0627\u0644\u0641\u0627\u062e\u0631\u0629. \u0637\u0628\u0642\u0627\u062a \u0631\u0642\u064a\u0642\u0629 \u062c\u062f\u0627\u064b \u0645\u0646 \u0639\u062c\u064a\u0646 \"\u0627\u0644\u0641\u064a\u0644\u0648\" \u0627\u0644\u0645\u0642\u0631\u0645\u0634\u060c \u0645\u062d\u0634\u0648\u0629 \u0628\u0623\u062c\u0648\u062f \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0641\u0633\u062a\u0642 \u0627\u0644\u062d\u0644\u0628\u064a \u0648\u0645\u0633\u0642\u064a\u0629 \u0628\u0627\u0644\u0642\u0637\u0631 \u0627\u0644\u062e\u0641\u064a\u0641. \u062a\u062c\u0631\u0628\u0629 \u0645\u0644\u0643\u064a\u0629 \u062a\u062c\u0645\u0639 \u0628\u064a\u0646 \u0627\u0644\u0642\u0631\u0645\u0634\u0629 \u0627\u0644\u0645\u062b\u0627\u0644\u064a\u0629 \u0648\u0627\u0644\u0645\u0630\u0627\u0642 \u0627\u0644\u063a\u0646\u064a.",
type: this.isService ? 'service' : 'product',
is_service: this.isService,
is_quote_mode: this.isQuoteMode,
should_force_quote: this.shouldForceQuote,
manage_stock: this.productManageStock,
allow_backorder: this.allowBackorder,
stock: this.currentStock,
sku: this.displaySku,
unit: "pi\u00e8ce",
currency: "TND",
image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/jGeBTJaK-1776332196.webp",
active_image: this.activeImage || "https:\/\/tamssmall.tn\/storage\/products\/jGeBTJaK-1776332196.webp",
gallery: activeGallery,
price: this.currentPrice,
price_formatted: this.formatPrice(this.currentPrice),
compare_price_formatted: "50,000",
seller: {"name":"DELICIA BY SAFA","url":"https:\/\/tamssmall.tn\/catalogue\/boutique\/delicia-by-safa-cBU7","logo":"https:\/\/tamssmall.tn\/storage\/sellers\/logos\/e1JEUOtyeSfcRYltaZ0GdgPf1Zj62gGKoMMRCQ7i.jpg"},
category: "P\u00e2tisserie",
wa_link: "https:\/\/wa.me\/24599294?text=Bonjour%2C+je+suis+int%C3%A9ress%C3%A9+par+%3A+%D8%A8%D9%82%D9%84%D8%A7%D9%88%D8%A9+%D8%AA%D8%B1%D9%83%D9%8A%D8%A9+%D8%A8%D8%A7%D9%84%D9%81%D8%B3%D8%AA%D9%82",
booking_enabled: true,
variants: mappedVariants,
selected_variant: this.selectedVariant ? {
...this.selectedVariant,
price_formatted: this.formatPrice(this.selectedVariant.price || 0)
} : null
}
}));
},
selectVariant(v) {
if (this.selectedVariant && this.selectedVariant.id === v.id) {
this.selectedVariant = null;
this.activeImage = "https:\/\/tamssmall.tn\/storage\/products\/jGeBTJaK-1776332196.webp";
} else {
this.selectedVariant = v;
if(v.image) this.activeImage = v.image;
}
},
selectGalleryImage(img, idx) {
this.selectedVariant = null;
this.activeImage = img;
this.galleryIndex = idx;
},
stepGallery(direction) {
if (!this.galleryImages.length) return;
this.selectedVariant = null;
this.galleryIndex = (this.galleryIndex + direction + this.galleryImages.length) % this.galleryImages.length;
this.activeImage = this.galleryImages[this.galleryIndex];
},
openQuantityPopup() {
if (this.variants.length > 0 && !this.selectedVariant) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.choose_option,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#f59e0b', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.choose_option); }
return;
}
if (this.purchaseBlocked && !this.isQuoteMode) {
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.trans.out_of_stock,
duration: 2500, gravity: 'bottom', position: 'center',
style: { background: '#ef4444', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
} else { alert(this.trans.out_of_stock); }
return;
}
this.qty = 1;
this.openQty = true;
},
toggleWishlist() {
this.inWishlist = !this.inWishlist;
if (!this.isAuth) {
let storageKey = 'smartbs_wishlist_' + this.tenantId;
let wl = JSON.parse(localStorage.getItem(storageKey) || '[]');
if (this.inWishlist) {
if (!wl.includes(this.id)) wl.push(this.id);
} else {
wl = wl.filter(id => id !== this.id);
}
localStorage.setItem(storageKey, JSON.stringify(wl));
window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { count: wl.length, product_id: this.id, added: this.inWishlist } }));
} else {
const url = 'https://tamssmall.tn/wishlist/toggle';
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=\'csrf-token\']').content, 'Accept': 'application/json' },
body: JSON.stringify({ product_id: this.id })
}).then(res => res.json())
.then(data => { window.dispatchEvent(new CustomEvent('wishlist-updated', { detail: { added: this.inWishlist, product_id: this.id } })); })
.catch(err => { this.inWishlist = !this.inWishlist; });
}
if (typeof Toastify !== 'undefined') {
Toastify({
text: this.inWishlist ? this.trans.added_fav : this.trans.removed_fav,
duration: 2000, gravity: 'bottom', position: 'center',
style: { background: this.inWishlist ? '#f43f5e' : '#64748b', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' }
}).showToast();
}
},
addToCart() {
this.openQty = false;
let variantId = this.selectedVariant ? this.selectedVariant.id : null;
let variantSku = this.selectedVariant ? this.selectedVariant.sku : null;
let variantName = this.selectedVariant ? this.selectedVariant.name : null;
let payload = { quantity: this.qty, variant_id: variantId, variant_sku: variantSku, variant_name: variantName };
const addUrl = 'https://tamssmall.tn/panier/ajouter/' + this.id;
const csrfToken = document.querySelector('meta[name=\'csrf-token\']')?.content;
fetch(addUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
body: JSON.stringify(payload)
}).then(res => res.json()).then(data => {
const count = data.cart_count ?? data.count ?? '+1';
const total = data.cart_total_formatted ?? data.total_formatted ?? null;
document.querySelectorAll('.cart-count-badge').forEach(el => el.innerText = count);
if (total) document.querySelectorAll('.cart-total-price').forEach(el => el.innerText = total);
window.dispatchEvent(new Event('cart-updated'));
if (typeof window.smartTrack === 'function') {
window.smartTrack('add_to_cart', {
entity_type: this.isService ? 'service' : 'product',
item_id: this.id,
item_name: "\u0628\u0642\u0644\u0627\u0648\u0629 \u062a\u0631\u0643\u064a\u0629 \u0628\u0627\u0644\u0641\u0633\u062a\u0642",
quantity: this.qty
});
}
let successMsg = '';
if(this.isQuoteMode) {
successMsg = variantName ? this.trans.opt_add_quote.replace(':name', variantName) : this.trans.prod_add_quote;
} else {
successMsg = variantName ? this.trans.opt_add.replace(':name', variantName) : this.trans.prod_add;
}
if (typeof Toastify !== 'undefined') {
Toastify({ text: '✅ ' + successMsg, duration: 2500, gravity: 'bottom', position: 'center', style: { background: '#10b981', color: '#fff', borderRadius: '10px', fontWeight: 'bold', marginBottom: '80px' } }).showToast();
} else { alert(successMsg + ' !'); }
}).catch(error => { console.error('Erreur:', error); });
}
}"
@mouseenter="isHovered = true" @mouseleave="isHovered = false"
class="group relative bg-white rounded-[2rem] p-3 md:p-4 border border-slate-100 hover:border-slate-200 transition-all duration-500 hover:shadow-2xl hover:shadow-slate-200/50 flex flex-col h-full"
style="--primary-color: #095155; --secondary-color: #ff429a;">
Vite, plus que
Aucun avis
En Rupture
-10%
بقلاوة تركية بالفستق
Sur Devis
50,000
TND
/ pièce
FR
EN
AR