دليلك الشامل لإضافة “ثمن الشحن” لمتجر يوكان (YouCan) لرفع نسبة التأكيد والمبيعات
يعتبر وضوح التكلفة الإجمالية للزبون قبل إتمام عملية الطلب أحد أهم أسرار النجاح في التجارة الإلكترونية بنظام الدفع عند الاستلام (COD). الكثير من أصحاب المتاجر على منصة يوكان يواجهون مشكلة إلغاء الطلبات بسبب تفاجؤ الزبون بوجود مصاريف شحن إضافية عند اتصال فريق التأكيد به.
في هذا المقال، سنعرفكم على الطريقة الأكثر فعالية واحترافية لإضافة سكريبت ثمن الشحن الذكي لمتجرك، والذي يضمن لك شفافية كاملة مع الزبون وتحسيناً ملحوظاً في تجربة المستخدم.
🚀 لماذا يعتبر هذا السكريبت ضرورياً لمتجرك؟
تكمن قوة هذا السكريبت في كونه يعمل بشكل آلي وتلقائي داخل صفحات متجرك، وإليك أهم المميزات التي سيقدمها لك:
1. زيادة ثقة الزبون
عندما يرى الزبون ثمن الشحن (مثلاً: 20 أو 30 درهم) مضافاً بوضوح بجانب سعر المنتج، فإنه يشعر بالاطمئنان والشفافية، مما يقلل من تردده في الضغط على زر الشراء.
2. التحديث التلقائي للأسعار
السكريبت مبرمج ليتفاعل مع اختيارات الزبون؛ فبمجرد اختيار عرض معين أو كمية محددة، يظهر له المجموع النهائي مع احتساب الشحن بشكل فوري، مما يعطي طابعاً احترافياً يشبه المتاجر العالمية مثل أمازون وجوميا.
3. تحسين “نسبة التأكيد” (Confirmation Rate)
بما أن الزبون أصبح واعياً بالتكلفة النهائية، فإن نسبة رفض الطلب عند اتصال فريق الـ Call Center تتناقص بشكل كبير، لأن عنصر المفاجأة بخصوص “ثمن التوصيل” قد تم إلغاؤه تماماً.
📥 لتحميل السكريبت والبدء في استخدامه فوراً، اضغط على الرابط أسفله:
🔗 اضغط هنا لتحميل سكريبت إضافة ثمن الشحن لمتجر يوكان
🛠️ كيف تقوم بتركيب السكريبت في متجرك؟ (خطوات بسيطة)
عملية التركيب سهلة جداً ولا تحتاج لأن تكون مبرمجاً، اتبع الخطوات التالية:
- تحميل الملف: قم أولاً بتحميل السكريبت من الرابط الموجود في هذه المقالة.
- نسخ الكود: افتح الملف وقم بنسخ الكود البرمجي الموجود بداخله بالكامل.
- التوجه للإعدادات: ادخل إلى لوحة تحكم متجرك في YouCan، ثم اذهب إلى الإعدادات (Settings).
- الأكواد المخصصة: اختر قسم “أكواد مخصصة” (Custom Codes).
- اللصق والحفظ: قم بلصق الكود في خانة Header ثم اضغط على زر حفظ.
بمجرد القيام بهذه الخطوات، قم بزيارة متجرك وستلاحظ ظهور ثمن الشحن بشكل أنيق تحت سعر المنتج مباشرة.
<script>
document.addEventListener("DOMContentLoaded", function () {
const priceContainer = document.querySelector(".single-price");
const qtyInputs = document.querySelectorAll(".single-quantity");
const hiddenQty = document.querySelector('#express-checkout-form input[name="quantity"]');
const checkout = document.querySelector("#express-checkout-section");
const originalForm = document.querySelector("#express-checkout-form");
if (!priceContainer || !qtyInputs.length || !hiddenQty || !checkout || !originalForm) return;
const SHIPPING_PRICE = 30;
const FREE_SHIPPING_LIMIT = 300;
document.querySelectorAll(".order-summary-box").forEach(el => el.remove());
const orderBox = document.createElement("div");
orderBox.className = "product-order-box";
orderBox.style.cssText = `
border: 2px solid #e0e0e0;
border-radius: 10px;
padding: 20px;
margin: 20px 0;
background: #f9f9f9;
`;
const summary = document.createElement("div");
summary.className = "order-summary-box";
summary.style.cssText = `
background: transparent;
border: none;
padding: 0;
margin: 15px 0;
`;
const variants = document.querySelector(".single-variants");
const checkoutForm = document.querySelector(".checkout-form");
const addToCart = document.querySelector(".add-to-cart-section");
if (variants) {
variants.style.marginBottom = "15px";
orderBox.appendChild(variants);
}
if (checkoutForm) {
checkoutForm.style.margin = "15px 0";
orderBox.appendChild(checkoutForm);
}
orderBox.appendChild(summary);
if (addToCart) {
addToCart.style.marginTop = "15px";
orderBox.appendChild(addToCart);
}
originalForm.appendChild(orderBox);
const style = document.createElement("style");
style.textContent = `
.product-order-box .form-label { display: none !important; }
.product-order-box .form-group { margin-bottom: 12px; }
.product-order-box .form-group input {
width: 100%;
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 14px;
background: white;
transition: border-color 0.3s;
}
.product-order-box .form-group input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}
.product-order-box .checkout-heading {
font-size: 16px;
margin-bottom: 15px;
color: #333;
}
.product-order-box .summary-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #eee;
}
.product-order-box .grand-total {
font-weight: bold;
font-size: 16px;
border-bottom: none;
margin-top: 5px;
}
.product-order-box .radio-buttons-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.product-order-box .radio-button-variant {
margin-bottom: 0;
}
.product-order-box .validate-error { display: none !important; }
`;
document.head.appendChild(style);
qtyInputs.forEach(input => {
if (!input.value) input.value = 1;
});
function getUnitPrice() {
const val = priceContainer.querySelector(".value");
if (!val) return 0;
return parseFloat(val.textContent.replace(/[^\d.]/g, "")) || 0;
}
function updateSummary() {
const unitPrice = getUnitPrice();
let qty = parseInt(qtyInputs[0].value);
if (isNaN(qty) || qty < 1) qty = 1;
qtyInputs.forEach(input => input.value = qty);
hiddenQty.value = qty;
const productTotal = unitPrice * qty;
let shipping = SHIPPING_PRICE;
let shippingText = SHIPPING_PRICE + " د.م";
if (productTotal >= FREE_SHIPPING_LIMIT) {
shipping = 0;
shippingText = "الشحن مجاني";
}
const total = productTotal + shipping;
summary.innerHTML = `
<div class="summary-row"><span>سعر المنتج</span><span>${productTotal} د.م</span></div>
<div class="summary-row"><span>تكلفة الشحن</span><span style="color:#28a745;font-weight:bold;">${shippingText}</span></div>
<div class="summary-row grand-total"><span>المجموع الإجمالي</span><span>${total} د.م</span></div>
`;
}
qtyInputs.forEach(input => {
input.addEventListener("input", updateSummary);
input.addEventListener("change", updateSummary);
});
document.querySelectorAll(".quantity-handler").forEach(btn => {
btn.addEventListener("click", () => setTimeout(updateSummary, 100));
});
document.querySelectorAll(".single-variants input").forEach(el => {
el.addEventListener("change", () => setTimeout(updateSummary, 300));
});
const observer = new MutationObserver(updateSummary);
observer.observe(priceContainer, { childList:true, subtree:true });
updateSummary();
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const blockedNumbers = [
"600000000",
"611111111",
"699691980", "665401616" ,"656285149","600902066","663132464","607569720","661371148","661615673","674409820","679116030","661241685","661580273"
];
function normalizeMoroccanNumber(input) {
if (!input) return "";
let number = input.replace(/[^\d]/g, "");
if (number.startsWith("00212")) {
number = number.slice(5);
} else if (number.startsWith("212")) {
number = number.slice(3);
}
if (number.startsWith("0")) {
number = number.slice(1);
}
return number;
}
function isValidMoroccanNumber(num) {
if (num.length !== 9) return false;
if (/^[67]\d{8}$/.test(num)) return true;
if (/^5[2-4]\d{7}$/.test(num)) return true;
return false;
}
function waitForElements() {
const phoneInput = document.querySelector(
'input[placeholder*="الهاتف"], input[placeholder*="رقم"]'
);
const submitButtons = document.querySelectorAll(".single-submit");
if (!phoneInput || submitButtons.length === 0) {
setTimeout(waitForElements, 300);
return;
}
function lockButtons(message) {
submitButtons.forEach(btn => {
btn.disabled = true;
btn.style.opacity = "0.6";
btn.style.cursor = "not-allowed";
btn.innerText = message;
});
}
function unlockButtons() {
submitButtons.forEach(btn => {
btn.disabled = false;
btn.style.opacity = "1";
btn.style.cursor = "pointer";
btn.innerText = "اضغط هنا للطلب";
});
}
phoneInput.addEventListener("input", unlockButtons);
phoneInput.addEventListener("blur", function () {
const rawValue = phoneInput.value.trim();
const normalized = normalizeMoroccanNumber(rawValue);
if (!rawValue) {
unlockButtons();
return;
}
if (normalized.length > 9) {
lockButtons("رقم الهاتف غير صالح");
return;
}
if (normalized.length < 9) {
lockButtons("رقم الهاتف غير مكتمل");
return;
}
if (!isValidMoroccanNumber(normalized)) {
lockButtons("رقم الهاتف غير صحيح");
return;
}
if (blockedNumbers.includes(normalized)) {
lockButtons("لا يمكنك الطلب – أرسل رسالة واتساب");
return;
}
unlockButtons();
});
}
waitForElements();
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const noticeBar = document.querySelector(".mobile-notice-bar .fr-view p");
if (!noticeBar) return;
const messages = [
"الشحن مجاني ابتداءً من 300 درهم 📦",
"ضمان الجودة أو استرداد المال 💯",
"خدمة عملاء 24/7 📞"
];
let currentIndex = 0;
const style = document.createElement("style");
style.textContent = `
.mobile-notice-bar .fr-view {
overflow: hidden;
position: relative;
}
.mobile-notice-bar .fr-view p {
transition: transform 0.5s ease-in-out;
white-space: nowrap;
margin: 0;
}
.slide-out-left {
transform: translateX(-100%) !important;
}
.slide-in-right {
transform: translateX(100%) !important;
}
`;
document.head.appendChild(style);
function changeMessage() {
noticeBar.style.transform = "translateX(-100%)";
setTimeout(() => {
noticeBar.textContent = messages[currentIndex];
noticeBar.style.transform = "translateX(100%)";
setTimeout(() => {
noticeBar.style.transform = "translateX(0)";
currentIndex = (currentIndex + 1) % messages.length;
}, 50);
}, 500);
}
setInterval(changeMessage, 4000);
});
</script>
<script>
(function () {
let initialized = false;
function initOfferEngineSafe() {
if (initialized) return;
const variantGroup = document.querySelector('.single-variants');
if (!variantGroup) return;
const radios = variantGroup.querySelectorAll('input[type="radio"]');
if (!radios.length) return;
if (document.querySelector('.global-offer-cards')) {
initialized = true;
return;
}
const container = document.createElement('div');
container.className = 'global-offer-cards';
radios.forEach((radio, index) => {
const priceMatch = radio.value.match(/(\d+)\s*درهم/);
const price = priceMatch ? priceMatch[1] : '';
const card = document.createElement('div');
card.className = 'offer-card' + (index === 1 ? ' best' : '');
card.dataset.index = index;
card.dataset.price = price;
card.innerHTML = `
<h3>${radio.value}</h3>
<p class="price">${price} د.م</p>
${index === 1 ? '<span class="badge">الأكثر مبيعًا</span>' : ''}
`;
card.addEventListener('click', () => {
radios.forEach(r => r.checked = false);
radio.checked = true;
container.querySelectorAll('.offer-card')
.forEach(c => c.classList.remove('active'));
card.classList.add('active');
const mainPrice = document.querySelector('.single-price .after .value');
if (mainPrice && price) {
mainPrice.textContent = price;
}
radio.dispatchEvent(new Event('change', { bubbles: true }));
});
container.appendChild(card);
});
variantGroup.parentNode.insertBefore(container, variantGroup);
let defaultIndex = [...radios].findIndex(r => r.checked);
if (defaultIndex === -1) defaultIndex = radios[0] ? 0 : 0;
radios[defaultIndex].checked = true;
container.children[defaultIndex]?.classList.add('active');
variantGroup.style.display = 'none';
initialized = true;
}
const interval = setInterval(() => {
initOfferEngineSafe();
if (initialized) clearInterval(interval);
}, 300);
})();
</script>
<style>
.global-offer-cards {
display: grid;
gap: 12px;
margin-bottom: 18px;
direction: rtl;
}
.offer-card {
background: #fffdf7;
border: 1px solid rgba(212,175,55,0.45);
border-radius: 14px;
padding: 14px 16px;
cursor: pointer;
position: relative;
transition: all .25s ease;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 12px;
}
.offer-card input[type="radio"] {
grid-column: 1;
justify-self: start;
accent-color: #d4af37;
transform: scale(1.1);
}
.offer-card h3 {
grid-column: 2;
margin: 0;
font-size: 15px;
font-weight: 700;
color: #2f2a1f;
text-align: right;
line-height: 1.4;
}
.offer-card .price {
grid-column: 3;
justify-self: end;
font-size: 20px;
font-weight: 900;
color: #000000;
white-space: nowrap;
}
.offer-card.active .price {
color: #dc2626;
}
.offer-card.active {
border-color: #d4af37;
box-shadow: 0 4px 14px rgba(212,175,55,0.25);
}
.offer-card .badge {
position: absolute;
top: -9px;
right: 12px;
background: linear-gradient(135deg,#d4af37,#b8962e);
color: #ffffff;
font-size: 11px;
font-weight: 800;
padding: 4px 10px;
border-radius: 999px;
letter-spacing: .4px;
}
@media (max-width: 768px) {
.offer-card {
padding: 13px 14px;
}
.offer-card .price {
font-size: 18px;
}
.offer-card h3 {
font-size: 14px;
}
}
</style>
<style>
.offer-card.active {
background: linear-gradient(180deg, #fff7e1, #fff1cc);
border-color: #d4af37;
box-shadow:
0 6px 18px rgba(212,175,55,0.35),
inset 0 0 0 1px rgba(212,175,55,0.6);
transform: translateY(-1px);
}
.offer-card.active .price {
color: #b91c1c;
font-size: 22px;
}
.offer-card.active::after {
content: "✔ مختار";
position: absolute;
bottom: 10px;
left: 12px;
background: #d4af37;
color: #ffffff;
font-size: 12px;
font-weight: 800;
padding: 4px 10px;
border-radius: 999px;
letter-spacing: .3px;
}
.offer-card.active input[type="radio"] {
accent-color: #d4af37;
transform: scale(1.2);
}
.offer-card {
transition: all .25s ease, transform .15s ease;
}
@media (max-width: 768px) {
.offer-card.active::after {
font-size: 11px;
padding: 3px 8px;
}
}
</style>
<style>
@keyframes softPulse {
0% {
box-shadow:
0 0 0 0 rgba(212,175,55,0.35),
0 6px 18px rgba(212,175,55,0.25);
}
50% {
box-shadow:
0 0 0 6px rgba(212,175,55,0),
0 8px 22px rgba(212,175,55,0.35);
}
100% {
box-shadow:
0 0 0 0 rgba(212,175,55,0),
0 6px 18px rgba(212,175,55,0.25);
}
}
.offer-card.active {
animation: softPulse 2.6s ease-in-out infinite;
}
.offer-card:active {
animation: none;
}
</style>
<style>
.global-offer-cards .offer-card .price {
display: none !important;
}
</style><script>
document.addEventListener("DOMContentLoaded", function () {
const freeShippingLimit = 200;
const shippingPrice = 30;
const subtotalEl = document.querySelector(".table-total tr:first-child .value");
const shippingRow = document.querySelector(".table-total tr:nth-child(2)");
const totalValueEl = document.querySelector(".tr-total .value");
const totalCurrencyEl = document.querySelector(".tr-total .currency");
if(!subtotalEl || !shippingRow || !totalValueEl) return;
if(shippingRow.dataset.processed) return;
shippingRow.dataset.processed = "1";
const rawSubtotal = subtotalEl.innerText.replace(/,/g,'').replace(/[^\d.]/g,'');
const subtotal = parseFloat(rawSubtotal);
if(isNaN(subtotal)) return;
const shippingValueEl = shippingRow.querySelector(".value");
const shippingCurrencyEl = shippingRow.querySelector(".currency");
let shipping = 0;
if(subtotal < freeShippingLimit){
shipping = shippingPrice;
shippingValueEl.innerText = shippingPrice;
if(shippingCurrencyEl) shippingCurrencyEl.innerText = " د.م";
} else {
shippingValueEl.innerText = "الشحن مجاني";
if(shippingCurrencyEl) shippingCurrencyEl.remove();
}
totalValueEl.innerText = subtotal + shipping;
if(totalCurrencyEl){
totalCurrencyEl.innerText = " د.م";
}
});
</script>🏁 كلمة خيرة
إن نجاحك في منصة يوكان يعتمد على التفاصيل الصغيرة التي تريح الزبون وتجعله يثق بمتجرك. سكريبت ثمن الشحن ليس مجرد أداة تقنية، بل هو استراتيجية تسويقية لتعزيز المصداقية ورفع مبيعاتك.
إذا كان لديك أي سؤال حول السكريبت، لا تتردد في تركه في التعليقات وسنقوم بالرد عليك في أقرب وقت!
