<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
const headerWrapper = document.querySelector(".header-wrapper");
if (!headerWrapper) {
console.error("Element with class 'header-wrapper' not found.");
return;
}
const slideshowContainer = document.createElement("div");
slideshowContainer.className = "slideshow-container";
const prevButton = document.createElement("a");
prevButton.className = "prev";
prevButton.textContent = "❮"; // Flipped the arrow text
slideshowContainer.appendChild(prevButton);
slideTexts.forEach((text) => {
const slide = document.createElement("div");
slide.className = "mySlides";
slide.textContent = text;
slideshowContainer.appendChild(slide);
});
const nextButton = document.createElement("a");
nextButton.className = "next";
nextButton.textContent = "❯"; // Flipped the arrow text
slideshowContainer.appendChild(nextButton);
headerWrapper.parentNode.insertBefore(slideshowContainer, headerWrapper);
let slideIndex = 0;
let slideTimeout;
function showSlide(index) {
const slides = document.getElementsByClassName("mySlides");
for (let slide of slides) {
slide.style.display = "none";
}
slides[index].style.display = "block";
clearTimeout(slideTimeout);
slideTimeout = setTimeout(nextSlide, 5000);
}
function nextSlide() {
slideIndex = (slideIndex + 1) % slideTexts.length;
showSlide(slideIndex);
}
function prevSlide() {
slideIndex = (slideIndex - 1 + slideTexts.length) % slideTexts.length;
showSlide(slideIndex);
}
nextButton.addEventListener("click", nextSlide);
prevButton.addEventListener("click", prevSlide);
showSlide(slideIndex);
});
</script>
<!--? Creating and Adding Molakhas Talabia into the Checkout Form -->
<script type="text/javascript">
let html = (document.querySelector(".checkout-form").innerHTML +=
"<span class= 'quantity-molakhasHeader-container'><div id='molakhas'> 🛒️ ملخص الطلبية ⬇ </div></span>");
</script>
<!--? Creating Quantity Element Manually -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// إنشاء حاوية التحكم بالكمية
const quantityContainer = document.createElement("div");
quantityContainer.className = "quantity";
// إنشاء زر الزيادة
const plusButton = document.createElement("span");
plusButton.className = "quantity-handler quantity-handler-right";
const plusIcon = document.createElement("i");
plusIcon.className = "yc yc-plus";
plusButton.appendChild(plusIcon);
// إنشاء حقل الإدخال
const quantityInput = document.createElement("input");
quantityInput.type = "number";
quantityInput.setAttribute("aria-label", "الكمية");
quantityInput.className = "single-quantity";
quantityInput.value = "1"; // القيمة الافتراضية
// إنشاء زر النقصان
const minusButton = document.createElement("span");
minusButton.className = "quantity-handler quantity-handler-left";
const minusIcon = document.createElement("i");
minusIcon.className = "yc yc-minus";
minusButton.appendChild(minusIcon);
// إضافة الأزرار وحقل الإدخال إلى حاوية التحكم بالكمية
quantityContainer.appendChild(plusButton);
quantityContainer.appendChild(quantityInput);
quantityContainer.appendChild(minusButton);
// إيجاد عنصر #molakhas
const molakhas = document.getElementById("molakhas");
// إدراج حاوية التحكم بالكمية قبل عنصر #molakhas
molakhas.parentNode.insertBefore(quantityContainer, molakhas);
// إضافة مستمعات للأحداث للأزرار (إذا لزم الأمر)
plusButton.addEventListener("click", function () {
quantityInput.value = parseInt(quantityInput.value, 10) + 1;
});
minusButton.addEventListener("click", function () {
const currentValue = parseInt(quantityInput.value, 10);
if (currentValue > 1) {
quantityInput.value = currentValue - 1;
}
});
});
</script>
<!--? Creating Important Variables -->
<script type="text/javascript">
let price, priceElement, currency, priceBefore, price_place, priceSection;
</script>
<!--? Function to extract product price, previous price, and currency based on the current page type -->
<script type="text/javascript">
function getProductPriceDetails() {
const primarySelectors = {
price: "div.product-price-container > span.product-price > span.value",
currency: "div.product-price-container > span.product-price > span.currency",
priceBefore: "div.product-price-container > span.product-compare-at-price > span.value",
price_place: "div.product-price-container > span.product-compare-at-price",
priceSection: "div.product-price-container",
};
const alternativeSelectors = {
price: "div.product-section.price-section > h2 > span.after.currency-value > span.value",
currency: "div.product-section.price-section > h2 > span.after.currency-value > span.currency",
priceBefore: "div.product-section.price-section > h2 > span.before.currency-value > span.value",
price_place: "div.product-section.price-section > h2 > span.before.currency-value",
priceSection: "div.product-section.price-section",
};
// Helper function to select content with fallback
function selectContent(selectors, key) {
return document.querySelector(selectors[key])?.textContent;
}
// Helper function to get elements with fallback
function selectElement(selectors, key) {
return document.querySelector(selectors[key]);
}
// Attempt to select using primary selectors, fallback to alternative selectors if null
const selectors = primarySelectors;
price = selectContent(selectors, 'price') || selectContent(alternativeSelectors, 'price');
currency = selectContent(selectors, 'currency') || selectContent(alternativeSelectors, 'currency');
priceBefore = selectContent(selectors, 'priceBefore') || selectContent(alternativeSelectors, 'priceBefore');
price_place = selectElement(selectors, 'price_place') || selectElement(alternativeSelectors, 'price_place');
priceSection = selectElement(selectors, 'priceSection') || selectElement(alternativeSelectors, 'priceSection');
}
// Call the function wherever needed
getProductPriceDetails();
</script>
<!--? Creating Molakhas Talabia Container -->
<script type="text/javascript">
const newContainer = document.createElement("div");
newContainer.id = "molakhasContainer"; // Optional: Set an ID or class for styling purposes
const checkoutSection = document.getElementById("express-checkout-form"); // Access the first element
// Append the new container to the target element
if (checkoutSection) {
checkoutSection.appendChild(newContainer);
} else {
console.log('Target element with class "express-checkout-form" not found.');
}
</script>
<!--? User Checkout Fields -->
<script type="text/javascript">
const nameNumber = "extra_fields[custom_field_nQwaxislxicMpK8d]"; // حقل رقم الهاتف
const nameWilaya = "extra_fields[custom_field_Gh0oTFM5pB2o0BZn]"; // حقل الولاية
const nameCommune = "extra_fields[custom_field_vCswnss13zdj1v3P]"; // حقل البلدية
const stoppdesk = "extra_fields[custom_field_XxTyqixK1VDlinE6]"; // حقل مكان التوصيل
const deliveryOption = "extra_fields[custom_field_XxTyqixK1VDlinE6]"; // حقل مكان التوصيل
const address = "extra_fields[custom_field_uXpka2pODqtz2Jfa]"; // حقل العنوان
const notesField = "extra_fields[custom_field_UAQH3KlK3ZhUvKnE]"; // حقل الملاحظات
const productPrice = "extra_fields[custom_field_kRbCf01EtJZdwDyJ]"; // حقل سعر المنتج
const deliveryPrice = "extra_fields[custom_field_gLxh3OVq9uBwaTF0]"; // حقل سعر التوصيل
const totalPrice = "extra_fields[custom_field_ifEOSyJvthcSseYt]"; // حقل السعر الإجمالي
const quantityNumber = "extra_fields[custom_field_rkMLvWUWIQFRgYhJ]"; // حقل الكمية
</script>
<!--? Initialize .Input Variables -->
<script type="text/javascript">
const productPriceInput = document.querySelector(
"input[name='" + productPrice + "']"
);
const deliveryPriceInput = document.querySelector(
"input[name='" + deliveryPrice + "']"
);
const totalPriceInput = document.querySelector(
"input[name='" + totalPrice + "']"
);
const quantityNumberInput = document.querySelector(
"input[name='" + quantityNumber + "']"
);
const SelectDeliveryOption = document.querySelector(
"select[name='" + deliveryOption + "']"
);
const submitButton = document.getElementsByClassName("single-submit");
const submitButtons = document.querySelectorAll(".single-submit");
quantityNumberInput.setAttribute("placeholder", "Quantité");
</script>
<!--? Toggle Address Input Field Based On Selected Delivery Option -->
<script type="text/javascript">
if (address && SelectDeliveryOption) {
const addressInput = document.querySelector(`input[name='${address}']`);
// addressInput.disabled = true;
const validIsAddressEnable = function () {
const isHomeDelivery = SelectDeliveryOption.value === "التوصيل للمنزل";
addressInput.disabled = !isHomeDelivery;
addressInput.required = isHomeDelivery;
if (addressInput.disabled) {
addressInput.placeholder = "";
} else {
addressInput.placeholder = "أدخل عنوان المنزل";
}
addressInput.value = "";
};
SelectDeliveryOption.addEventListener("change", validIsAddressEnable);
}
</script>
<!--? Set phone number validation, enable submit button, and configure location fields (Wilaya and Commune) -->
<script type="text/javascript">
// Retrieve the input field for the phone number using its name attribute
const my_pattern = document.getElementsByName(nameNumber);
my_pattern[0].setAttribute("id", nameNumber); // Set the ID for the input field
my_pattern[0].setAttribute("oninput", "myFunctionRegex(),myFunctionRegex1()"); // Set the oninput event to trigger validation functions
my_pattern[0].setAttribute("pattern", "(05|06|07)[0-9]{8}"); // Set the regex pattern for the phone number format
//! Validate the entered phone number and adjust the appearance based on validity
function myFunctionRegex() {
// Check if the entered phone number matches the specified pattern
document.getElementById(nameNumber).value.match(/^(05|06|07)[0-9]{8}$/)
? (my_pattern[0].style.setProperty(
"background-color",
"white",
"important" // Set background color to white if valid
),
my_pattern[0].style.setProperty("color", "black", "important"), // Set text color to black
submitButton[0].removeAttribute("disabled")) // Enable the submit button
: (my_pattern[0].style.setProperty(
"background-color",
"#f8d7da",
"important" // Set background color to light red if invalid
),
my_pattern[0].style.setProperty("color", "black", "important"), // Set text color to black
submitButton[0].setAttribute("disabled", "")); // Disable the submit button
}
function myFunctionRegex1() {
// Similar validation function for another submit button
document.getElementById(nameNumber).value.match(/^(05|06|07)[0-9]{8}$/)
? (my_pattern[0].style.setProperty(
"background-color",
"white",
"important" // Set background color to white if valid
),
my_pattern[0].style.setProperty("color", "black", "important"), // Set text color to black
submitButton[1].removeAttribute("disabled")) // Enable the submit button
: (my_pattern[0].style.setProperty(
"background-color",
"#f8d7da",
"important" // Set background color to light red if invalid
),
my_pattern[0].style.setProperty("color", "black", "important"), // Set text color to black
submitButton[1].setAttribute("disabled", "")); // Disable the submit button
}
var inverval_timer, // Declare an interval timer for resetting fields
my_commune = document.getElementsByName(nameCommune); // Retrieve the commune input field
my_commune[0].setAttribute("id", "citySelect"); // Set the ID for the commune field
my_commune[0].setAttribute("required", ""); // Mark the field as required
var my_wilaya = document.getElementsByName(nameWilaya); // Retrieve the wilaya input field
my_wilaya[0].setAttribute("id", "countrySelect"); // Set the ID for the wilaya field
// my_wilaya[0].setAttribute("onchange", "makeSubmenu(this.value)"), // Optional: Add onchange event to update submenu
my_wilaya[0].setAttribute("required", ""); // Mark the field as required
document.getElementById("countrySelect")[0].setAttribute("selected", ""); // Set the country field as selected
document.getElementById("citySelect")[0].setAttribute("selected", ""); // Set the city field as selected
// Set up an interval to reset and disable the fields every second
inverval_timer = setInterval(function () {
document.getElementById("countrySelect")[0].setAttribute("value", ""); // Reset the value of the country field
document.getElementById("countrySelect")[0].setAttribute("disabled", ""); // Disable the country field
document.getElementById("citySelect")[0].setAttribute("value", ""); // Reset the value of the city field
document.getElementById("citySelect")[0].setAttribute("disabled", ""); // Disable the city field
}, 1e3);
</script>
<!--? Configure Wilaya and Commune -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded",function(){let a=[];["01: أدرار","02: الشلف","03: الأغواط","04: أم البواقي","05: باتنة","06: بجاية","07: بسكرة","08: بشار","09: البليدة","10: البويرة","11: تمنراست","12: تبسة","13: تلمسان","14: تيارت","15: تيزي وزو","16: الجزائر","17: الجلفة","18: جيجل","19: سطيف","20: السعيدة","21: سكيكدة","22: سيدي بلعباس","23: عنابة","24: قالمة","25: قسنطينة","26: المدية","27: مستغانم","28: المسيلة","29: معسكر","30: ورقلة","31: وهران","32: البيض","33: إليزي","34: برج بوعريريج","35: بومرداس","36: الطارف","37: تندوف","38: تيسمسيلت","39: الوادي(واد سوف)","40: خنشلة","41: سوق اهراس","42: تيبازة","43: ميلة","44: عين الدفلى","45: النعامة","46: عين تموشنت","47: غرداية","48: غليزان","49: تيميمون","50: برج باجي مختار","51: أولاد جلال","52: بني عباس","53: عين صالح","54: عين قزام","55: توقرت","56: جانت","57: المغير","58: المنيعة"].forEach(e=>{var a=document.createElement("option");a.innerHTML=e,a.value=e,document.body.querySelector(`select[name='${nameWilaya}']`).appendChild(a)}),document.body.querySelector(`select[name='${nameWilaya}']`).addEventListener("change",()=>{var e=document.body.querySelector(`select[name='${nameWilaya}']`).value;const c=document.body.querySelector(`select[name='${nameCommune}']`);for(;1<c.childNodes.length;)c.removeChild(c.lastChild);switch(e){case"01: أدرار":a=["أدرار","تامست","شروين","رقان","إن زغمير","تيت","قصر قدور","تسابيت","تيميمون","أولاد السعيد","زاوية كونتة","أولف","تيمقتن","تامنطيت","فنوغيل","تنركوك","دلدول","سالي","أقبلي","المطارفة","أولاد أحمد تيمي","بودة","أوقروت","طالمين","برج باجي مختار","السبع","أولاد عيسى","تيمياوين"];break;case"02: الشلف":a=["الشلف","تنس","بنايرية","الكريمية","تاجنة","تاوقريت","بني حواء","صبحة","حرشون","أولاد فارس","سيدي عكاشة","بوقادير","بني راشد","تلعصة","الهرنفة","وادى قوسين","الظهرة","أولاد عباس","السنجاس","الزبوجة","وادي سلي","أبو الحسن","المرسى","الشطية","سيدي عبد الرحمان","مصدق","الحجاج","الأبيض مجاجة","وادي الفضة","أولاد بن عبد القادر","بوزغاية","عين مران","أم الذروع","بريرة","بني بوعتاب"];break;case"03: الأغواط":a=["الأغواط","قصر الحيران","بن ناصر بن شهرة","سيدي مخلوف","حاسي الدلاعة","حاسي الرمل","عين ماضي","تاجموت","الخنق","قلتة سيدي سعد","عين سيدي علي","البيضاء","بريدة","الغيشة","الحاج المشري","سبقاق","تاويالة","تاجرونة","أفلو","العسافية","وادي مرة","وادي مزي","الحويطة","سيدي بوزيد"];break;case"04: أم البواقي":a=["أم البواقي","عين البيضاء","عين مليلة","بحير شرقي","العامرية","سيقوس","البلالة","عين بابوش","بريش","أولاد حملة","الضلعة","عين كرشة","هنشير تومغني","الجازية","عين الديس","فكرينة","سوق نعمان","الزرق","الفجوج بوغرارة سعودي","أولاد زواي","بئر الشهداء","قصر صباحي","وادي نيني","مسكيانة","عين فكرون","الراحية","عين الزيتون","أولاد قاسم","الحرميلية"];break;case"05: باتنة":a=["باتنة","غسيرة","معافة","مروانة","سريانة","منعة","المعذر","تازولت","نقاوس","القيقبة","إينوغيسن","عيون العصافير","جرمة","بيطام","عزيل عبد القادر","آريس","كيمل","تيلاطو","عين جاسر","أولاد سلام","تيغرغار","عين ياقوت","سفيان","فسديس","الرحبات","تيغانمين","لمسان","قصر بلزمة","سقانة","إشمول","فم الطوب","بني فضالة الحقانية","وادي الماء","تالخمت","بوزينة","الشمرة","وادي الشعبة","تاكسلانت","القصبات","أولاد عوف","بومقر","بريكة","الجزار","تكوت","عين التوتة","حيدوسة","ثنية العابد","وادي الطاقة","أولاد فاضل","تيمقاد","رأس العيون","شير","أولاد سي سليمان","زانة البيضاء","أمدوكال","أولاد عمار","الحاسي","لازرو","بومية","بولهيلات","لارباع"];break;case"06: بجاية":a=["بجاية","بوخليفة","تيشي","تالة حمزة","أميزور","تامريجت","أوقاس","آيت سماعيل","تاسكريوت","تمقرة","آغرام","كسيلة","تاوريرت آغيل","أمالو","بوحمزة","كنديرة","خراطة","فرعون","بني جليل","القصر","توجة","بوجليل","بني مليكش","سوق أوفلة","شميني","تيفرة","تينبذار","سيدي عياد","تيمزريت","سيدي عيش","لفلاي","أكفادو","تيبيان","آيت أرزين","إيغيل علي","فناية الماثن","سمعون","ذراع القايد","مرباشة","مسيسنة","صدوق","أوزلاقن","آدكار","شلاطة","أقبو","بني معوش","درقينة","تيزي أنبربار","سوق الإثنين","ملبو","وادي غير","تازمالت","شميني جنان"];break;case"07: بسكرة":a=["بسكرة","ليوة","لوطاية","جمورة","البرانيس","القنطرة","عين زعطوط","سيدي عقبة","شتمة","تكوت","الحوش","عين الناقة","زربية الوادي","المزيرعة","خنقة سيدي ناجي","الفيض","مشونش","طولقة","بوشقرون","برج بن عزوز","ليشانه","فوغاله","الغروس","أولاد جلال","الدوسن","الشعيبة","سيدي خالد","البسباس","راس الميعاد","اورلال","أوماش","مليلي","مخادمة","الحاجب"];break;case"08: بشار":a=["بشار","القنادسة","المريجة","المريجة","بني ونيف","لحمر","موغل","بوكايس","تاغيت","العبادلة","عرق فراج","مشرع هواري بومدين"];break;case"09: البليدة":a=["البليدة","شبلي","بوينان","وادي العلايق","أولاد يعيش","الشريعة","العفرون","الشفة","حمام ملوان","بن خليل","الصومعة","موزاية","صوحان","مفتاح","أولاد السلامة","بوفاريك","الأربعاء","واد جر","بني تامو","بوعرفة","بني مراد","بوقرة","قرواو","عين الرمانة","الجبابرة"];break;case"10: البويرة":a=["البويرة","عين الترك","ايت لعزيز","الأخضرية","قرومة","معالة","بودربالة","بوكرام","الزبربر","قادرية","عمر","جباحية","سوق الخميس","المقراني","بئر اغبالو","الروراوة","الخبوزية","عين بسام","عين العلوي","عين الحجر","سور الغزلان","المعمورة","ديرة","ريدان","الحاكمية","الدشمية","برج اخريص","مسدور","تاقديت","الحجرة الزرقاء","الهاشمية","وادي البردي","امشدالة","احنيف","الشرفة","صحاريج","اث منصور","اغبالو","بشلول","العجيبية","الأسنام","اهل القصر","اولاد راشد","حيزر","تاغزوت"];break;case"11: تمنراست":a=["تمنراست","ابلسة","ادلس","فقارة الزوى","عين غار","عين قزام","عين صالح","تاظروك","تين زاوتين","عين امقل"];break;case"12: تبسة":a=["تبسة","بئر العاتر","الشريعة سطح قنطيس","العوينات","الحويجبات","صفصاف الوسرة","الحمامات","نقرين","بئر مقدم","الكويف","مرسط","العقلة","بئر الذهب","العقلة المالحة","قريقر","بكارية","بوخضرة","الونزة","الماء الأبيض","أم علي","ثليجان","عين الزرقاء","المريج","بولحاف الدير","بجن","المزرعة","فركان"];break;case"13: تلمسان":a=["تلمسان","المنصورة","تيرني بني ھديل","عين غرابة","بني مستار","شتوان","عين فزة","عمير","أولاد ميمون","الواد الأخضر","بني صميل","عين تالوت","عين نحالة","بن سكران","سيدي العبدلي","الرمشي","بني ورسوس","عين يوسف","السبعة شيوخ","الفحول","الحناية","زناتة","أولاد رياح","الغزوات","السواحلية","تيانت","دار يغمراسن","ندرومة","جبالة","فلاوسن","عين فتاح","عين الكبيرة","مغنية","حمام بوغرارة","بني بوسعيد","سيدي مجاهد","صبرة","بوحلو","سبدو","القور","العريشة","سيدي الجيلالي","البويهي","بني سنوس","العزايل","بني بهدل","باب العسة","السواني","سوق الثلاثاء","مرسى بن مهيدي","مسيردة الفواقة","هنين","بني خلاد"];break;case"14: تيارت":a=["توسنينة","عين بوشقيف","عين الذهب","عين الحديد","عين الكرمة","عين زاريت","بوغرة","شهايمة","دحموني","جبيلات رصفة","جيلالي بن عمر","فايجة","فرندة","قرطوفة","حمادية","قصر الشلالة","مادنة","مهدية","مشروع الصفا","مدريسة","مدروسة","مغيلة","ملاكو ندورة","النعيمة","واد ليلي","ولاد جراد","رحوية","رشيقة سباين","سبت","سرغين","سي عبد الغاني","سيدي علي ملال","سيدي بختي","سيدي الحسني","السوقر","تاقدمت","تخمارت","تيارت","تيدة","زمالة الأمير عبد القادر"];break;case"15: تيزي وزو":a=["تيزي وزو","واسيف","أيت بومهدي","أيت تودرت","عين الحمام","أيت يح أقبيل","أبي يوسف","عزازقة","فريحة","زكري","إعكوران","إيفيغاء","بوغني","مشطراس","بونوح","أسي يوسف","ذراع الميزان","فريقات","عين الزاوية","أيت يحي موسى","واقنون","تيميزارت","جبل عيسى ميمون","الأربعاء نايث إيراثن","أيت قواشة","إرجن","أزفون","أقرو","أيت شفعة","أغريب","ذراع بن خدة","تادمايت","سيدي نعمان","ترمتين","تقزيرت","إفليسن","مزرانة","بوزغن","إجر","إيلولة أمالو","بني زيكي","بني دوالة","أيت محمود","بني عيسي","بني زمنزر","واضية","أقني قغران","تيزي نثلاثة","أيت بوعدو","المعاتقة","سوق الإثنين","مقلع","أيت خليلي","الصوامع","بني يني","يطافن","إبودرارن","تيزي راشد","أيت أومالو","إيفرحونن","أمسوحال","إليلتن","تيزي غنيف","مكيرة","ماكودة","بوجيمة"];break;case"16: الجزائر":a=["الجزائر الوسطى","سيدي امحمد","المدنية","المرادية","باب الواد","القصبة","بولوغين","واد قريش","رايس حميدو","المقارية","الحامة - العناصر بلوزداد","حسين داي","القبة","بن عكنون","بني مسوس","بوزريعة","الأبيار","بئر مراد رايس","بئر خادم","جسر قسنطينة","حيدرة","سحاولة","باش جراح","بوروبة","الحراش","وادي السمار","عين طاية","باب الزوار","برج البحري","برج الكيفان","الدار البيضاء","المرسى","المحمدية","عين البنيان","الشراقة","دالي ابراهيم","أولاد فايت","الحمامات","المحالمة","الرحمانية","السويدانية","سطاوالي","زرالدة","بابا حسن","دويرة","الدرارية","العاشور","خرايسية","بئر توتة","أولاد شبل","تسالة المرجة","براقي","الكاليتوس","سيدي موسى","هراوة","الرغاية","الرويبة"];break;case"17: الجلفة":a=["الجلفة","عين وسارة","القرنيني","البيرين","بنهار","سيدي لعجال","الخميس","حاسي فدول","حد الصحاري","بويرة الأحداب","عين أفقه","حاسي بحبح","الزعفران","حاسي العش","عين معبد","دار الشيوخ","مليليحة","سيدي بايزيد","الشارف","القديد","بن يعقوب","الإدريسية","الدويس","عين الشهداء","عين الإبل","مجبارة","تعضميت","زكار","مسعد","دلدول","سلمانة","سد رحال","قطارة","فيض البطمة","عمورة","أم العظام"];break;case"18: جيجل":a=["جيجل","الأمير عبد القادر","اولاد رابح","اولاد يحيى خدروش","ايراقن سويسي","برج الطهر","بودريعة بن ياجيس","بوراوي بلهادف","بوسيف","تاكسنة","الجمعة بني حبيبي","جيملة","خيري واد اعجول","زيامة منصورية","السطارة","سلمى بن زيادة","سيدي عبد العزيز","سيدي معروف","الشحنة","الشقفة","الطاهير","العنصر","العوانة","غبالة","قاوس","القنار نشفي","الميلية","وجانة"];break;case"19: سطيف":a=["عين عباسة","عين أرنات","عين الكبيرة","عين آزال","عين لحجر","عين لقراج","عين ولمان","عين الروى","عين السبت","آيت نوال","آيت تيزي","عموشة","ّ عين الروا","ّ عين الروى","بابور","بازر سكرة","بيضاء برج","بلاعة","بني عزيز","بني شيبانة","بني فودة","بني حسين","بني محلي","بني ورتيلان","بئر العرش","بئر حدادة","بوعنداس","بوقاعة","بوسلام","بوطالب","دهامشة","جميلة","ذراع قبيلة","العلمة","الولجة","الأوريسية","قلال","القلتة الزرقاء","قنزات","ڤجال","رأس الماء","الحامة","حمام قرقور","حربيل","قصر الأبطال","معاوية","ماوكلان","مزلوق","واد البارد","اولاد عدوان","اولاد صابر","اولاد تبان","ام لعجول","رسفة","صالح باي","سرج الغول","سطيف","تاشودة","تالة ايفاسن","الطاية","تلة","تيزي نبشار","ولاد السي أحمد","تيزي نبراهم"];break;case"20: السعيدة":a=["سعيدة","عين الحجر","عين السخونة","عين سلطان","ذوي ثابت","الحساسنة","معمورة","مولاي لعربي","أولاد براهيم","أولاد خالد","سيدي أحمد","سيدي اعمر","سيدي بوبكر","تيرسين","أيوب","هونة"];break;case"21: سكيكدة":a=["سكيكدة","حمادي كرومة","فلفلة","الحدائق","بوشطاطة","عين زويت","رمضان جمال","بني بشير","الحروش","صالح بوالشعور","أمجاز الدشيش","زردازة","أولاد أحبابة","سيدي مزغيش","عين بوزيان","بني ولبان","عزابة","السبت","لغدير","جندل","عين شرشار","بن عزوز","المرسى","بكوش لخضر","تمالوس","الكركرة","بين الويدان","القل","بني زيد","الشرايع","زيتونة","قنواع","عين قشرة","الوجلة بوالبلوط","أولاد عطية","خناق مايون","وادي الزهور","أم الطوب"];break;case"22: سيدي بلعباس":a=["أولاد علي","أمرناس","بئر الحمام","بدر الدين المقراني","بلعربي","بن باديس","بن عشيبة شلية","بوجبع البرج","بوخنيفيس","تاودموت","تسالة","تلموني","تفسور","تغاليمت","تلاغ","تنزارة","تنيرة","حاسي دحو","حاسي زهانة","الحصيبة","رأس الماء","رجم دموش","زروالة","سهالة ثاورة","سفيزف","سيدي اٍبراهيم","سيدي بلعباس","سيدي حمادوش","سيدي خالد","سيدي دحو الزائر","سيدي شعيب","سيدي علي بن يوب","سيدي علي بوسيدي","سيدي لحسن","سيدي يعقوب","شيطوان بليلة","الضاية","طابية","عين أدان","عين البرد","عين تندامين","عين الثريد","عين قادة","لمطار","مرحوم","مرين","مزاورو","مسيد","مصطفى بن إبراهيم","مقدرة","مولاي سليسن","واد تاوريرة","واد سفيون","واد السبع"];break;case"23: عنابة":a=["عنابة","برحال","الحجار","العلمة","البوني","وادي العنب","الشرفة","سرايدي","عين الباردة","شطايبي","سيدي عمار","تريعات"];break;case"24: قالمة":a=["قالمة","قلعة","بو صبيع","بومهرة احمد","جبالة الخميسي","الفجوج","بن جراح","بلخير","بوعاتي محمود","هيليوبوليس","نشامية","بني مزلين","لخزارة","بوشقوف","مجاز الصفاء","حمام النبائل","وادي الشحم","الدهوارة","عين بن بيضاء","وادي فراغة","عين صندل","بوحشانة","وادي الزناتي","راس العقبة","عين رقادة","بوحمدان","برج صباط","الركنية","سلاوة عنونة","عين مخلوف","تاملوكة","حمام دباغ","مجاز عمار","عين العربي","هواري بومدين"];break;case"25: قسنطينة":a=["قسنطينة","الخروب","عين سمارة","أولاد رحمون","عين عبيد","ابن باديس","زيغود يوسف","بني حميدان","حامة بوزيان","ديدوش مراد","ابن زياد","مسعود بوجريو"];break;case"26: المدية":a=["أم الجليل","أولاد إبراهيم","أولاد بو عشرة","أولاد دايد","أولاد عنتر","أولاد معرف","أولاد هلال","البرواقية","بن شكاو","بني سليمان","بوسكن","بوشراحيل","بو عيش","بو عيشون","بوغار","بوغزول","بعطة","بئر بن عابد","تابلاط","تافراوت","تمزقيدة","تيزي المهدي","ثلاثة الدوائر","جواب","الحمدانية","حناشة","الحوضان","خمس جوامع","دراق","ذراع السمار","الربعية","الزبيرية","سانق","سدراية","سغوان","السواقي","سي المحجوب","سيدي دامد","سيدي الربيع","سيدي نعمان","سيدي زهار","سيدي زيان","الشهبونية","عزيز","العزيزية","العمارية","العوينات","العيساوية","عين بوسيف","عين القصير","قصر البخاري","القلب الكبير","الكاف الأخضر","مغراوة","المدية","مجبر","المفاتحة","مزغنة","ميهوب","وامري","وزرة","وادي حربيل"];break;case"27: مستغانم":a=["مستغانم","ستيدية","مزغران","حاسي مماش","الصور","سيدي بلعطار","واد الخير","عين تادلس","سيرات، السوافلية","الصفصاف","بوقيرات","تازقايت","أولاد مع الله","سيدي علي","نقمارية","خضرة","أولاد بوغالم","عشعاشة","فرناكة، الحسيان","عين النويصي","منصورة","الطواهرية","عين سيدي","شريف ماسرى","حجاج","بن عبد المالك رمضان","سيدي لخضر","صيادة","عين بودينار","خير الدين"];break;case"28: المسيلة":a=["المسيلة","أولاد دراج","أولاد سليمان","أولاد سيدي إبراهيم","أولاد عدي القبالة","أولاد عطية","أولاد ماضي","أولاد منصور","أولتام","الحوامد","الزرزور","المعاريف","المعاضيد","الهامل","بئر الفضة","برهوم","بلدية ثنية الشارة","بلدية مناعة","بلعايبة","بن سرور","بنزوه","بني يلمان","بوسعادة","بوطي السايح","تارمونت","تامسة","جبل أمساعد","حمام الضلعة","خبانة","خطوطي سد الجير","الدهاهنة","سليم","سيدي امحمد","سيدي عامر","سيدي عيسى","سيدي هجرس","شلال","الصوامع","عين الحجل","عين الريش","عين الملح","عين الخضراء","عين فارس","مجدل","محمد بوضياف","مسيف","المطارفة","مقرة","ونوغة"];break;case"29: معسكر":a=["معسكر","البرج","البنيان","السحايلية","الشرفة","الصحاورية","العلايمية","الغمري","القعدة","القيطنة","المامونية","المحمدية","المنور","الهاشم","بوحنيفية","بوهني","تيزي","تيغنيف","حسين","خلوية","دوار الملح","رأس عين عميروش","زلامطة","زهانة","سجرارة","سيدي بوسعيد","سيدي عبد الجبار","سيدي عبد المؤمن","سيدي قادة","عقاز","عوف","عين افرص","عين فارس","عين فراح","عين فكان","غروس","غريس","فراقيق","فروحة","قرجوم","القرط","ماقضة","ماوسة","مطمور","مقطع دوز","نسموط","وادي الأبطال","وادي تاغية"];break;case"30: ورقلة":a=["ورقلة","الطيبات","بن ناصر","المنقر","مقارين","سيدي سليمان","تماسين","بلدة أعمر","الحجيرة","العالية","النقوسة","سيدي خويلد","عين البيضاء","حاسي بن عبد الله","الرويسات","البرمة","حاسي مسعود","تقرت","الزاوية العابدية","النزلة","تبسبست"];break;case"31: وهران":a=["وهران","أرزيو","العلايمية","الكرمة","بئر الجير","البرية","بطيوة","بن فريحة","بوتليليس","بوسفر","بوفاطيس","حاسي بن عقبة","حاسي بونيف","حاسي مفسوخ","دوار الملح","السانية","سيدي الشحمي","سيدي بن يبقى","سيق","طفراوي","العنصر","عين البية","عين الترك","عين الكرمة","قديل","مرسى الحجاج","المرسى الكبير","مسرغين","وادي تليلات"];break;case"32: البيض":a=["البيض","أربوات","الأبيض سيدي الشيخ","البنود","الخيثر","الرقاصة","الشلالة","المحرة","بريزينة","بوسمغون","بوعلام","بوقطب","توسمولين","ستيتن","سيدي سليمان","سيدي طيفور","سيدي عمر","شقيق","عين العراك","الغاسول","كاف لحمر","كراكدة"];break;case"33: إليزي":a=["ايليزي","جانت","الدبداب","برج عمر ادريس","برج الحواس","ان امناس"];break;case"34: برج بوعريريج":a=["برج بوعريريج","أولاد براهم","أولاد دحمان","أولاد سيدي إبراهيم","الجعافرة","الحمادية","العش","العناصر","القلة","القليعة","الماين","المهير","بئر قصد علي","برج الغدير","برج زمورة","بلدية عين تسرة","بليمور","بن داود","تاسمرت","تفرق","تفـرق","تقلعيت","تكستار","ثنية النصر","حرازة","حسناوة","خليل","رأس الوادي","الرابطة","سيدي امبارك","عين تاغروت","غيلاسة","غيلاسة برج الغدير","القصور","مجانة","المنصورة","اليشير"];break;case"35: بومرداس":a=["بومرداس","أولاد عيسى","أولاد موسى","أولاد هداج","اعفير","الأربعطاش","الثنية","الخروبة","الناصرية","برج منايل","بغلية","بن شود","بني عمران","بودواو","بودواو البحري","تاورقة","تجلابين","تيمزريت","جنات","حمادي","خميس الخشنة","دلس","زلزال زموري","زموري","سوق الحد","سي مصطفى","سيدي داود","شعبة العامر","عمال","قدارة","قورصو","لقاطة","يسر"];break;case"36: الطارف":a=["الطارف","بحيرة الطيور","بريحان","البسباس","بن مهيدي","بوثلجة","بوحجار","بوقوس","حمام بني صالح","الذرعان","رمل السوق","زريزر","الزيتونة","السوارخ","الشافية","شبيطة مختار","الشط","الشيحاني","عصفور","عين العسل","عين الكرمة","العيون","القالة","واد الزيتون"];break;case"37: تندوف":a=["تيندوف","أم العسل"];break;case"38: تيسمسيلت":a=["تيسمسيلت","ثنية الحد","برج بونعامة","لرجام","الأزهرية","الأربعاء","بوقايد","سيدي سليمان","بني شعيب","بني لحسن","عماري","اليوسفية","سيدي بوتشنت","الملعب","سيدي عابد","أولاد بسام","خميستي","العيون","برج الأمير عبد القادر","سيدي العنتري","تملاحت","المعاصم"];break;case"39: الوادي(واد سوف)":a=["الوادي","أميه ونسة","البياضة ","الحمادين","الحمراية","الدبيلة","الرباح ","الرقيبة","الطريفاوي","العقلة ","المقرن ","النخلة ","بن قشة","تغزوت ","تندلة","حاسي خليفة","حساني عبد الكريم","دوار الماء","سيدي عون","طالب العربي","عين الشوشة","قمار ","كوينين ","وادي العلندة","ورماس","وغلانة"];break;case"40: خنشلة":a=["خنشلة","المحمل","عين الطويلة","بابار","بغاي","بوحمامة","شيليا","ششار","جلال","الحامة","الولجة","أنسيغة","قايس","خيران","لمصارة","متوسة","أولاد رشاش","رميلة","طامزة","يابوس","تاوزيانت"];break;case"41: سوق اهراس":a=["سوق أهراس","أم العظائم","أولاد إدريس","أولاد مؤمن","الحنانشة","الراقوبة","الزوابي","بئر بوحوش","تاورة","ترقالت","تيفاش","الحدادة","الخضارة","خميسة","الدريعة","الزعرورية","سافل الويدان","سدراتة","سيدي فرج","عين زانة","عين سلطان","مادور","مداوروش","المراهنة","المشروحة","وادي الكبريت","ويلان"];break;case"42: تيبازة":a=["تيبازة","أغبال","الداموس","الشعيبة","الناظور","بني ميلك","بو إسماعيل","بورقيقة","بوهارون","حجرة النص","حجوط","حطاطبة","حمر العين","خميستي","دواودة","سيدي اعمر","سيدي راشد","سيدي سميان","سيدي غيلاس","شرشال","عين تقورايت","فوكة","القليعة","قوراية","لارهاط","مراد","مسلمون","مناصر"];break;case"43: ميلة":a=["ميلة","أحمد راشدي","أولاد خلوف","التلاغمة","الرواشد","العياضي برباس","القرارم قوقة","المشيرة","بن يحيى عبد الرحمان","بوحاتم","تاجنانت","تبرقنت","ترعي باينان","تسالة لمطاعي","تسدان حدادة","حمالة","دراحي بوصلاح","رجاص","زغاية","سيدي خليفة","سيدي مروان","شلغوم العيد","الشيقارة","عميرة أراس","عين البيضاء حريش","عين التين","عين الملوك","فرجيوة","مينار زارزة","وادي العثمانية","وادي النجاء","وادي سقان","يحيى بن قشة"];break;case"44: عين الدفلى":a=["عين الدفلى","الحسنية","الحسينية","الروينة","العبادية","الماين","المخاطرية","بئر ولد خليفة","بربوش","برج الأمير خالد","بطحية","بلعاص","بن علال","بوراشد","بومدفع","تاشتة زقاغة","تسيلي","تيبركانين","جليدة","جمعة ولاد الشيخ","جندل","حمام ريغة","خميس مليانة","زدين","سيدي الأخضر","طارق بن زياد","العامرة","عريب","العطاف","عين بنيان","عين بويحيى","عين تركي","عين سلطان","عين لشياخ","مليانة","واد الشرفاء","وادي الجمعة"];break;case"45: النعامة":a=["النعامة","المشرية","عين الصفراء","تيوت","صفيصيفة","مغرار","عسلة","جنين بورزق","عين بن خليل","بن عمار","القصدير","البيوض"];break;case"46: عين تموشنت":a=["عين تموشنت","بوزجار","المالح","تارقة","حمام بوحجر","بني صاف","شعبة اللحم","الأمير عبد القادر","سيدي الصافي","تامازوغة","وادي الصباح","اغلال","أولاد الكيحل","عقب الليل","حاسى الغلة","أولاد بوجمعة","سيدي بن عدة","العامرية","عين الطلبة","عين الأربعاء","ولهاصة الغرابة","سيدي ورياش","عين الكيحل","مساعيد","وادي برقش","شنتوف","الحساسنة","سيدي بومدين"];break;case"47: غرداية":a=["غرداية","العطف","بريان","بنورة","حاسي الفحل","حاسي القارة","زلفانة","سبسب","ضاية بن ضحوة","القرارة","متليلي","المنصورة"];break;case"48: غليزان":a=["غليزان","أولاد سيدي الميهوب","أولاد يعيش","الحمادنة","الرمكة","القطار","القلعة","المرجة","المطمر","الولجة","بلعسل","بن داود","بني درقن","بني زنطيس","جديوية","الحاسي","حد الشكالة","حمري","دار بن عبد الله","زمورة","سوق الحد","سيدي امحمد بن علي","سيدي خطاب","سيدي سعادة","سيدي لزرق","سيدي محمد بن عودة","عمي موسى","عين الرحمة","عين طارق","لحلاف","مازونة","مديونة","منداس","واد الجمعة","واد السلام","وادي ارهيو","واريزان","يلل"];break;case"49: تيميمون":a=["تيميون","أولاد السعيد","أقروت","دلدول","المطرفة","تينركوك","قصر قدور","شروين","طلمين","أولاد عيسى"];break;case"50: برج باجي مختار":a=["برج باجي مختار","تيمياوين"];break;case"51: أولاد جلال":a=["اولاد جلال","البسباس","الشعيبة","الدوسن","سيدي خالد","راس الميعاد"];break;case"52: بني عباس":a=["بن عباس","بني يخلف","الواتة","إقلي","كرزاز","قصابي","أولاد خدير","تبلبالة","تامترت","تيمودي"];break;case"53: عين صالح":a=["عين صالح","فقارة الزاوية","عين غار"];break;case"54: عين قزام":a=["عين قزام","تين زواتين"];break;case"55: توقرت":a=["البرمة","الحجيرة","الزاوية العابدية","الطيبات","العالية ","المنقر","النزلة ","بلدة عمر","بن ناصر","تبسبست","تقرت","تماسين","سيدي سليمان ","مقارين"];break;case"56: جانت":a=["جانت","برج الحواس"];break;case"57: المغير":a=["المغير","أم الطيور ","اسطيل","تندلة","جامعة ","سيدي خليل","سيدي عمران","مرارة"];break;case"58: المنيعة":a=["المنيعة","حاسي القارة","المنصورة ","حاسي لفحل"]}a.forEach(e=>{var a=document.createElement("option");a.innerHTML=e,a.value=e,c.appendChild(a)})})});
</script>
<!--? Adding The Product Price Into MolkhasContainer -->
<script type="text/javascript">
$(document).ready(function () {
productprice();
});
//!Set the product price and add it to Container
function productprice() {
getProductPriceDetails();
const html = `<div id= productprice><h5>- سعر المنتج 💵 × الكمية</h5><h6>${price} ${currency}</h6></div>`;
const container = document.getElementById("molakhasContainer");
if (container) {
container.insertAdjacentHTML("beforeend", html);
} else {
console.error('Container with ID "molakhasContainer" not found.');
}
}
</script>
<!--? Calculate the delivery price based on the selected Wilaya -->
<script type="text/javascript">
$(document).ready(function () {
addWilayaContainer();
});
function addWilayaContainer() {
const html =
"<div id='tarifWilayaContainer'><h5>- سعر التوصيل 🚚️ </h5><h6>اختر الولاية</h6></div>";
const container = document.getElementById("molakhasContainer");
if (container) {
container.insertAdjacentHTML("beforeend", html);
} else {
console.error('Container with ID "molakhasContainer" not found.');
}
}
$(document).on("change", function () {
const radioButtons = document.querySelectorAll(
'input[name="إختر العرض اللذي يناسبك"]'
);
const lastRadioButton = radioButtons[radioButtons.length - 1];
const wilaya = $("select[name='" + nameWilaya + "']").val();
const stopdesk = $("select[name='" + stoppdesk + "']").val();
$("#tarifWilayaContainer").html("");
let html = "";
const deliveryPrice = {
"01: أدرار": { home: 1400, office: 1100 },
"02: الشلف": { home: 800, office: 650 },
"03: الأغواط": { home: 950, office: 800 },
"04: أم البواقي": { home: 800, office: 650 },
"05: باتنة": { home: 800, office: 650 },
"06: بجاية": { home: 800, office: 650 },
"07: بسكرة": { home: 950, office: 800 },
"08: بشار": { home: 1400, office: 1100 },
"09: البليدة": { home: 500, office: 400 },
"10: البويرة": { home: 600, office: 550 },
"11: تمنراست": { home: 1600, office: 1500 },
"12: تبسة": { home: 950, office: 800 },
"13: تلمسان": { home: 800, office: 650 },
"14: تيارت": { home: 800, office: 650 },
"15: تيزي وزو": { home: 800, office: 650 },
"16: الجزائر": { home: 500, office: 400 },
"17: الجلفة": { home: 950, office: 800 },
"18: جيجل": { home: 800, office: 650 },
"19: سطيف": { home: 800, office: 650 },
"20: سعيدة": { home: 800, office: 650 },
"21: سكيكدة": { home: 800, office: 650 },
"22: سيدي بلعباس": { home: 800, office: 650 },
"23: عنابة": { home: 800, office: 650 },
"24: قالمة": { home: 800, office: 650 },
"25: قسنطينة": { home: 800, office: 650 },
"26: المدية": { home: 600, office: 550 },
"27: مستغانم": { home: 800, office: 650 },
"28: المسيلة": { home: 800, office: 650 },
"29: معسكر": { home: 800, office: 650 },
"30: ورقلة": { home: 950, office: 800 },
"31: وهران": { home: 800, office: 650 },
"32: البيض": { home: 1400, office: 1100 },
"33: إليزي": { home: 1600, office: 1500 },
"34: برج بوعريريج": { home: 800, office: 650 },
"35: بومرداس": { home: 600, office: 550 },
"36: الطارف": { home: 800, office: 650 },
"37: تندوف": { home: 1600, office: 1500 },
"38: تيسمسيلت": { home: 800, office: 650 },
"39: الوادي": { home: 950, office: 800 },
"40: خنشلة": { home: 800, office: 650 },
"41: سوق أهراس": { home: 800, office: 650 },
"42: تيبازة": { home: 600, office: 550 },
"43: ميلة": { home: 800, office: 650 },
"44: عين الدفلى": { home: 600, office: 550 },
"45: النعامة": { home: 1400, office: 1100 },
"46: عين تموشنت": { home: 800, office: 650 },
"47: غرداية": { home: 950, office: 800 },
"48: غليزان": { home: 800, office: 650 },
};
if (deliveryPrice[wilaya]) {
const price = deliveryPrice[wilaya];
if (stopdesk == "التوصيل للمكتب") {
html = `<h5>- سعر التوصيل 🚚</h6><h6>${price.office} دج</h6>`;
deliveryPriceInput.value = price.office;
} else {
html = `<h5>- سعر التوصيل 🚚</h6><h6>${price.home} دج</h6>`;
deliveryPriceInput.value = price.home;
}
} else {
html = "<h5>- سعر التوصيل 🚚</h5><h6>اختر الولاية</h6>";
}
submitButtons.forEach(function (button) {
button.removeAttribute("disabled");
});
const priceMatch = html.match(/(\d+)\s?دج/);
if (priceMatch) {
const priceValue = parseInt(priceMatch[1]);
if (priceValue === 0) {
if (stopdesk == "التوصيل للمكتب") {
html = "<h5>- سعر التوصيل 🚚</h5><h6>التوصيل للمكتب غير متوفر</h6>";
} else if (stopdesk == "التوصيل للمنزل") {
html = "<h5>- سعر التوصيل 🚚</h5><h6>التوصيل للمنزل غير متوفر</h6>";
}
submitButtons.forEach(function (button) {
button.setAttribute("disabled", "");
});
}
}
if (lastRadioButton && lastRadioButton.checked) {
html = "<h5>- سعر التوصيل 🚚</h5><h6>التوصيل مجاني</h6>";
deliveryPriceInput.value = "0";
}
$("#tarifWilayaContainer").html(html);
const h6Element = document.querySelector("#tarifWilayaContainer > h6");
if (
h6Element.textContent === "التوصيل للمنزل غير متوفر" ||
h6Element.textContent === "التوصيل للمكتب غير متوفر"
) {
h6Element.classList.add("reduce-size");
}
});
</script>
<!--? Calculate the total amount and update the price based on changes -->
<script type="text/javascript">
$(document).ready(function () {
total();
});
function total() {
const html =
"<div id='total'><h5>- المبلغ الاجمالي 💰️</h5><h6>المنتج + التوصيل</h6></div>";
const container = document.getElementById("molakhasContainer");
if (container) {
container.insertAdjacentHTML("beforeend", html);
} else {
console.error('Container with ID "molakhasContainer" not found.');
}
}
$(document).on("change", function () {
const wilaya = $("select[name='" + nameWilaya + "']").val();
const product = parseInt(
document.querySelector("#productprice > h6").textContent
);
let ship = document.querySelector("#tarifWilayaContainer > h6").textContent;
function containsNumbers(str) {
return /\d/.test(str);
}
if (containsNumbers(ship) || ship === "التوصيل مجاني") {
getProductPriceDetails();
let price1 = parseInt(ship) || 0;
let total1 = product + price1;
function updatePrice() {
ship = document.querySelector("#tarifWilayaContainer > h6").textContent;
price1 = parseInt(ship) || 0;
if (price1 || ship === "التوصيل مجاني") {
getProductPriceDetails();
const quantity = parseInt(
document.querySelector(".single-quantity").value
);
const unitPrice = parseFloat(price);
if (quantity >= 1) {
total1 = price1 + unitPrice * quantity;
totalPriceInput.value = total1;
quantityNumberInput.value = quantity;
document.querySelector("#total h6").textContent = total1 + " د.ج";
}
}
}
document
.querySelectorAll(".quantity-handler-left, .quantity-handler-right")
.forEach(function (button) {
button.addEventListener("click", updatePrice);
});
updatePrice();
totalPriceInput.value = total1;
const wilayas = [
"01: أدرار",
"02: الشلف",
"03: الأغواط",
"04: أم البواقي",
"05: باتنة",
"06: بجاية",
"07: بسكرة",
"08: بشار",
"09: البليدة",
"10: البويرة",
"11: تمنراست",
"12: تبسة",
"13: تلمسان",
"14: تيارت",
"15: تيزي وزو",
"16: الجزائر",
"17: الجلفة",
"18: جيجل",
"19: سطيف",
"20: السعيدة",
"21: سكيكدة",
"22: سيدي بلعباس",
"23: عنابة",
"24: قالمة",
"25: قسنطينة",
"26: المدية",
"27: مستغانم",
"28: المسيلة",
"29: معسكر",
"30: ورقلة",
"31: وهران",
"32: البيض",
"33: إليزي",
"34: برج بوعريريج",
"35: بومرداس",
"36: الطارف",
"37: تندوف",
"38: تيسمسيلت",
"39: الوادي(واد سوف)",
"40: خنشلة",
"41: سوق اهراس",
"42: تيبازة",
"43: ميلة",
"44: عين الدفلى",
"45: النعامة",
"46: عين تموشنت",
"47: غرداية",
"48: غليزان",
"49: تيميمون",
"50: برج باجي مختار",
"51: أولاد جلال",
"52: بني عباس",
"53: عين صالح",
"54: عين قزام",
"55: توقرت",
"56: جانت",
"57: المغير",
"58: المنيعة",
];
let html = "<h5>- المبلغ الاجمالي 💰️</h5><h6>المنتج + التوصيل</h6>";
if (wilayas.includes(wilaya)) {
html =
"<h5>- المبلغ الاجمالي 💰️</h5><h6>" +
total1 +
" " +
currency +
"</h6>";
}
$("#total").html(html);
} else {
console.log("The variable does not contain numbers.");
const html = "<h5>- المبلغ الاجمالي 💰️</h5><h6>المنتج + التوصيل</h6>";
$("#total").html(html);
}
});
</script>
<!--? Calculate And Display The Discount -->
<script type="text/javascript">
(function () {
const priceBeforeElement =
document.querySelector(
"div.product-section.price-section > h2 > span.before.currency-value > span.value"
) ||
document.querySelector(
"div.product-price-container > span.product-compare-at-price > span.value"
);
if (priceBeforeElement) {
getProductPriceDetails();
if (typeof priceBefore !== "undefined" && priceBefore !== null) {
const price_aft = price;
const price_bef = priceBefore;
const price1_bef = parseInt(price_bef, 10);
const price1_aft = parseInt(price_aft, 10);
if (!isNaN(price1_bef) && !isNaN(price1_aft) && price1_bef > 0) {
const disCount = document.createElement("span");
disCount.setAttribute("class", "discount_prcnt");
const prcntg = (price1_aft * 100) / price1_bef;
const prcntg1 = Math.round(100 - prcntg).toString();
disCount.innerHTML = `
<style>
.discount_prcnt {
background-color: var(--primary-color);
font-weight: bold;
border-radius: 4px;
padding: 2px 5px;
color: #fff;
font-size: 15px;
margin-left: 20px;
margin-right: 0.8rem;
}
</style>
خصم ${prcntg1}%
`;
if (price_place) {
price_place.after(disCount);
}
}
}
}
})();
</script>
<!--? Updating the price -->
<script type="text/javascript">
$(document).ready(function () {
// Function to update the price
function updatePrice() {
getProductPriceDetails();
const unitPrice = parseFloat(price);
const quantity = parseInt(
document.querySelector(".single-quantity").value
);
// Ensure valid values are being used
if (!isNaN(unitPrice) && !isNaN(quantity)) {
const totalPrice = unitPrice * quantity;
document.querySelector("#productprice h6").textContent =
totalPrice + " د.ج";
}
}
// Event listeners for plus and minus buttons
document
.querySelectorAll(".quantity-handler-left")
.forEach(function (button) {
button.addEventListener("click", updatePrice);
});
document
.querySelectorAll(".quantity-handler-right")
.forEach(function (button) {
button.addEventListener("click", updatePrice);
});
// Initialize the price display
updatePrice();
// Optionally, you can also handle changes in quantity input directly
document
.querySelector(".single-quantity")
.addEventListener("change", updatePrice);
});
</script>
<!--? Change the Form's Title -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Select the element with the class "checkout-heading"
var heading = document.querySelector(".checkout-heading");
// Check if the element exists and contains the text "معلومات الزبون"
if (heading) {
// Change the text content
heading.textContent = "إستمارة الطلب";
}
});
</script>
<!--? Adding a Title before the Quantity Container -->
<script type="text/javascript">
// Wait for the DOM to load completely
document.addEventListener("DOMContentLoaded", function () {
// Select the quantity container element
const quantityContainer = document.querySelector(".quantity");
if (quantityContainer) {
// Create a new element for the title
const titleElement = document.createElement("p");
titleElement.textContent = "الكمية";
titleElement.style.fontWeight = "bold"; // Optional styling
titleElement.style.marginBottom = "2px"; // Optional styling
titleElement.style.marginRight = "35px"; // Optional styling
titleElement.style.fontSize = "16px"; // Optional styling
titleElement.style.color = "#000000"; // Set the color of the title
// Insert the title before the quantity container
quantityContainer.parentNode.insertBefore(
titleElement,
quantityContainer
);
}
});
</script>
<!--? Apply styles to product items and product images -->
<script type="text/javascript">
// Select all elements with the class 'product-thumbnail img'
const thumbnailImages = document.querySelectorAll(".product-thumbnail img");
// Function to set the border-radius of a specific product item to 5px
function setBorderRadius(item) {
item.style.borderRadius = "5px";
}
// Function to reset the border-radius of a specific product item to 0
function resetBorderRadius(item) {
item.style.borderRadius = "0";
}
// Add event listeners to thumbnail images for hover effect
thumbnailImages.forEach((img) => {
const productItem = img.closest(".product-item"); // Get the nearest .product-item related to this img
img.addEventListener("mouseover", () => {
resetBorderRadius(productItem); // Reset the border-radius for this specific product item
});
img.addEventListener("mouseout", () => {
setBorderRadius(productItem); // Set the border-radius for this specific product item back to 5px
});
// Apply styles to the top corners of the image initially
img.style.borderTopRightRadius = "5px";
img.style.borderTopLeftRadius = "5px";
});
</script>
<!--? Monitor price changes and update the total price -->
<script type="text/javascript">
// Wait for the DOM to be fully loaded
document.addEventListener("DOMContentLoaded", function () {
getProductPriceDetails();
productPriceInput.value = price;
// Check if the priceSection element exists
if (priceSection) {
// Create a MutationObserver to monitor changes within priceSection
const observer = new MutationObserver((mutationsList) => {
mutationsList.forEach((mutation) => {
if (mutation.type === "childList" || mutation.type === "subtree") {
// Try to find the target value element
getProductPriceDetails();
const valueElement = priceElement;
if (valueElement) {
// Your code to execute on value change
const price2 = valueElement.textContent;
productPriceInput.value = price2;
const quantity = parseInt(
document.querySelector(".single-quantity").value
);
const priceMultiplyQuantity = price2 * quantity;
document.querySelector("#productprice h6").textContent =
priceMultiplyQuantity + " د.ج";
const totalh6 = document.querySelector("#total h6").textContent;
if (/\d/.test(totalh6)) {
const ship = document.querySelector(
"#tarifWilayaContainer > h6"
).textContent;
const shipPrice = parseInt(ship);
const total2 = shipPrice + parseInt(price2) * quantity;
// console.log("happens")
totalPriceInput.value = total2;
document.querySelector("#total h6").textContent =
total2 + " د.ج";
} else {
console.log("No it does not contains numbers");
}
}
}
});
});
// Configure the observer to detect changes in the entire subtree of priceSection
const config = { childList: true, subtree: true };
// Start observing the priceSection for any changes
observer.observe(priceSection, config);
// console.log("Observer set on priceSection:", priceSection);
} else {
console.log("priceSection element not found.");
}
});
</script>
<!--? Insert a red bold asterisk above each field and dynamically update the delivery address field -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", () => {
// Function to insert new text element (span) with a red bold * above each field
function insertTextAboveField(fieldSelector, text, addAsterisk = true) {
const field = document.querySelector(fieldSelector);
if (field) {
// Create new span element for the label text
const newText = document.createElement("span");
newText.textContent = text;
// Optionally add a red bold *
if (addAsterisk) {
const asterisk = document.createElement("span");
asterisk.textContent = "* ";
asterisk.style.color = "red";
asterisk.style.fontWeight = "bold";
newText.insertBefore(asterisk, newText.firstChild); // Add the * before the label text
}
newText.classList.add("new-field-text"); // Optional: Add a class for styling
// Insert new span element above the field
field.parentElement.insertBefore(newText, field);
}
}
// Insert new text spans with * above each field, except for "ملاحظات" and "عنوان المنزل"
insertTextAboveField('input[name="first_name"]', "الإسم و اللقب");
insertTextAboveField('input[name="' + nameNumber + '"]', "رقم الهاتف");
insertTextAboveField('select[name="' + nameWilaya + '"]', "الولاية");
insertTextAboveField('select[name="' + nameCommune + '"]', "البلدية");
insertTextAboveField('select[name="' + stoppdesk + '"]', "مكان التوصيل");
insertTextAboveField(
'input[name="' + address + '"]',
"عنوان المنزل",
false
);
insertTextAboveField('input[name="' + notesField + '"]', "ملاحظات", false);
// Add event listener to the "مكان التوصيل" select field to dynamically update "عنوان المنزل"
const deliverySelect = document.querySelector(
'select[name="' + stoppdesk + '"]'
);
const addressSpan = document.querySelector(
'input[name="' + address + '"]'
).previousElementSibling;
// Function for updating the asterisk
function updateAddressAsterisk() {
const selectedValue = deliverySelect.value;
if (selectedValue === "التوصيل للمنزل") {
// Add the red bold * to "عنوان المنزل"
if (!addressSpan.querySelector(".asterisk")) {
const asterisk = document.createElement("span");
asterisk.textContent = "* ";
asterisk.style.color = "red";
asterisk.style.fontWeight = "bold";
asterisk.classList.add("asterisk");
addressSpan.insertBefore(asterisk, addressSpan.firstChild);
}
} else {
// Remove the red bold * from "عنوان المنزل"
const asterisk = addressSpan.querySelector(".asterisk");
if (asterisk) {
addressSpan.removeChild(asterisk);
}
}
}
// Calling the function for the first time
updateAddressAsterisk();
deliverySelect.addEventListener("change", () => {
updateAddressAsterisk();
});
});
</script>
<!--? Hide specific fields by adding a CSS class -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Select the hidden fields
const hiddenFields = [
deliveryPrice,
productPrice,
totalPrice,
quantityNumber,
];
hiddenFields.forEach((field) => {
const element = document.querySelector(`input[name="${field}"]`);
if (element) {
element.classList.add("hidden-field");
}
});
});
</script>
<!--? Handle quantity input and button states -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Function to update the button states based on the quantity
function updateButtonStates() {
const quantityInput = document.querySelector(".single-quantity");
const quantity = parseInt(quantityInput.value) || 0;
const plusButton = document.querySelector(".quantity-handler-right");
const plusIcon = plusButton.querySelector(".yc-plus");
// Disable or enable the plus button based on the quantity
if (quantity > 100) {
plusButton.classList.add("disabled");
plusIcon.classList.add("disabled");
} else {
plusButton.classList.remove("disabled");
plusIcon.classList.remove("disabled");
}
}
// Handle the click event for the plus button
document
.querySelector(".quantity-handler-right")
.addEventListener("click", function () {
const quantityInput = document.querySelector(".single-quantity");
const quantity = parseInt(quantityInput.value) || 0;
if (quantity < 100) {
quantityInput.value = quantity + 1;
updateButtonStates();
}
});
// Handle the click event for the minus button
document
.querySelector(".quantity-handler-left")
.addEventListener("click", function () {
const quantityInput = document.querySelector(".single-quantity");
const quantity = parseInt(quantityInput.value) || 0;
if (quantity > 1) {
quantityInput.value = quantity - 1;
updateButtonStates();
}
});
// Handle the input event for the quantity input field
document
.querySelector(".single-quantity")
.addEventListener("input", function () {
const quantity = parseInt(this.value) || 0;
if (quantity > 100) {
this.value = 100;
}
updateButtonStates();
});
// Initialize the button states based on the initial quantity
updateButtonStates();
});
</script>
<!--? Handle quantity input and button states for product ordering -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
const quantityInput = document.querySelector(".single-quantity");
const plusButton = document.querySelector(".quantity-handler-right");
const minusButton = document.querySelector(".quantity-handler-left");
let quantity = parseInt(quantityInput.value) || 0;
function updateQuantity() {
quantity = parseInt(quantityInput.value) || 0;
if (quantity > 100) {
quantityInput.value = 100;
plusButton.classList.add("disabled");
plusButton.style.pointerEvents = "none";
alert(
"إذا أردت طلب كمية أكبر من 100 فرجائا أذكر هذا في خانة الملاحظات 👇"
);
} else {
plusButton.classList.remove("disabled");
plusButton.style.pointerEvents = "auto";
}
}
function handlePlusClick() {
if (quantity < 100) {
quantityInput.value = ++quantity;
updateQuantity();
}
}
function handleMinusClick() {
if (quantity > 1) {
quantityInput.value = --quantity;
updateQuantity();
}
}
plusButton.addEventListener("click", handlePlusClick);
minusButton.addEventListener("click", handleMinusClick);
quantityInput.addEventListener("input", updateQuantity);
});
</script>
<!--? Handle quantity input and plus button states -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Select the quantity input element and plus button
const quantityInput = document.querySelector(".single-quantity");
const plusButton = document.querySelector(".quantity-handler-right");
// Check if the quantityInput and plusButton elements exist
if (quantityInput && plusButton) {
// console.log("yes1");
// Use setInterval to periodically check the quantity value
let lastQuantity = quantityInput.value;
setInterval(() => {
const quantity = quantityInput.value;
// Only proceed if the quantity has changed
if (quantity !== lastQuantity) {
lastQuantity = quantity;
// console.log("yes2");
// Reset the plus button when quantity is 1
if (quantity === "1") {
// console.log("yes3");
plusButton.classList.remove("disabled");
plusButton.style.pointerEvents = "auto";
}
}
}, 100); // Check every 100ms
} else {
console.log("Quantity input or plus button element not found.");
}
});
</script>
<!--? Save product details in localStorage -->
<script type="text/javascript">
// Define the saveMolakhasContainer function
function saveMolakhasContainer() {
getProductPriceDetails();
const theProduct = document.querySelector("h1").textContent;
console.log(theProduct);
const theProductPrice = price;
console.log(theProductPrice);
const theProductQuantity = parseInt(
document.querySelector(".single-quantity").value
);
console.log(theProductQuantity);
localStorage.setItem("theProduct", theProduct);
localStorage.setItem("theProductPrice", theProductPrice);
localStorage.setItem("theProductQuantity", theProductQuantity);
const molakhasContainer = document.querySelector("#molakhasContainer");
console.log(molakhasContainer);
if (molakhasContainer) {
// Save the molakhasContainer HTML to localStorage
console.log("Yes molakhasContainer is here");
localStorage.setItem(
"molakhasContainerHTML",
molakhasContainer.outerHTML
);
} else {
console.log("No molakhasContainer is not here");
}
}
// Attach the saveMolakhasContainer function to the onclick event of all elements with the class "single-submit"
const Boutton = document.getElementsByClassName("single-submit");
for (let counter = 0; counter < Boutton.length; ++counter) {
Boutton[counter].setAttribute("onclick", "saveMolakhasContainer()");
}
</script>
<!--? Moving the description section after the checkout form -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Select the parent and the child element you want to move
const parentElement = document.querySelector(".product-details");
const childElement = document.querySelector(
".product-section.description-section"
);
// Move the child element to the end of the parent element
if (parentElement && childElement) {
parentElement.appendChild(childElement);
}
});
</script>
<!--? Customazing Related Products Section -->
<script type="text/javascript">
let relatedProductsHeading = document.querySelector(
"#related-products .container .app-heading .heading-primary"
);
// relatedProductsHeading.textContent = "Other Colors";
</script>
<!--? Disable the submit button if the product unavailable -->
<!-- <script>
$(document).on("change", function () {
submitButtons.forEach(function (button) {
if (button.textContent.trim() === "المنتج غير متوفر") {
button.setAttribute("disabled", "");
} else {
button.removeAttribute("disabled");
}
});
});
</script> -->
<!--! CSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS -->
<!--? Root Colors Setting -->
<style>
:root {
--second-color: var(--primary-color);
--border-color: #000;
--form-background: #e7e6ea;
}
</style>
<!--? Slide-Show Styling -->
<style>
.slideshow-container {
display: flex;
justify-content: space-evenly;
align-items: center;
background-color: var(--second-color);
color: white;
max-width: 100%;
height: 1.875rem; /* 30px */
position: relative;
text-align: center;
margin: 0 auto;
padding: 0.625rem 0; /* 10px */
font-size: 1rem; /* 16px */
}
.mySlides {
font-size: 0.8125rem; /* 13px */
display: none;
color: #fff;
font-weight: bold;
padding: 0.625rem 0; /* 10px */
width: 80% !important;
}
.slideshow-container .prev,
.slideshow-container .next {
cursor: pointer;
width: auto;
color: white;
font-weight: 100;
font-size: 0.75rem; /* 12px */
transition: 0.3s;
-webkit-user-select: none;
user-select: none;
}
.slideshow-container .prev {
right: 0;
border-radius: 3px 0 0 3px; /* Keep px for border-radius */
}
.slideshow-container .next {
left: 0;
border-radius: 0 3px 3px 0; /* Keep px for border-radius */
}
.slideshow-container .prev:hover,
.slideshow-container .next:hover {
background-color: rgba(0, 0, 0, 0.5);
}
</style>
<!--? Header Styling -->
<style>
#app-header {
border-bottom: 0.2px solid #eff9f8;
}
</style>
<!--? Store page Styling -->
<style>
[dir]
.single-product
.product-wrapper
.product-details
.product-section:not(:last-child) {
margin: auto;
margin-bottom: 1.25rem;
}
#app + div span {
display: none;
}
.product-item .product-price .before {
font-weight: bold;
}
/* price ligne */
.product-item .product-price .before {
text-decoration: none;
position: relative;
}
.product-item .product-price .before::before {
top: 50%;
background: red;
opacity: 0.7;
content: "";
width: 110%;
position: absolute;
height: 1.5px;
border-radius: 0.1em;
left: -5%;
white-space: nowrap;
display: block;
transform: rotate(-10deg);
}
.product-item .product-price .before.straight::before,
.product-item .product-price .before.straight::before {
transform: rotate(0deg);
left: -1%;
width: 102%;
}
.single-product .single-price span.before {
text-decoration: none;
position: relative;
}
.single-product .single-price span.before::before {
top: 60%;
background: red;
opacity: 0.7;
content: "";
width: 110%;
position: absolute;
height: 2px;
border-radius: 0.1em;
left: -5%;
white-space: nowrap;
display: block;
transform: rotate(-10deg);
}
.single-product .single-price span.before.straight::before,
.single-product .single-price span.before.straight::before {
transform: rotate(0deg);
left: -1%;
width: 102%;
}
.single-price {
padding: 0.625rem;
}
.takhfid {
color: #696969;
font-size: 0.8125rem;
padding-top: 0.9375rem;
padding-bottom: 0.4375rem;
}
h88 {
text-align: left;
font-size: 1em;
}
h98 {
text-align: left;
}
#molakhas p {
display: flex;
flex-direction: row;
margin: 0 0 -0.75rem 0;
font-size: 0.9375rem;
font-weight: bold;
}
div#molakhas {
font-weight: bolder;
color: var(--primary-color);
font-size: 1.25rem !important;
text-align: center;
margin-top: 0.125rem;
}
#molakhas p:before,
#molakhas p:after,
.checkout-heading:before,
.checkout-heading:after {
content: "";
flex: 1 1;
border-bottom: 1px solid;
margin: auto;
}
#molakhas p:before,
.checkout-heading:before {
margin-right: 0.625rem;
}
#molakhas p:after,
.checkout-heading:after {
margin-left: 0.625rem;
}
.discount_badge {
position: relative;
font-size: 0.875rem;
display: inline-block;
height: 1.5rem;
line-height: 1.5rem;
background-color: var(--primary-color);
color: #fff;
padding: 0 0.3125rem;
border-radius: 3px;
font-weight: 700;
}
.discount_badge {
margin-right: 0.75rem;
top: -0.1875rem;
animation: zoom 1s infinite linear;
}
@keyframes zoom {
0% {
transform: scale(0.9);
}
10% {
transform: scale(1);
}
80% {
transform: scale(0.9);
}
100% {
transform: scale(0.9);
}
}
.single-product .single-submit:hover {
border-color: #000000ff;
}
[dir] .checkout-section .checkout .main .checkout-form .checkout-heading {
font-size: 1.2rem;
font-weight: 800;
margin-bottom: 0.9375rem;
}
@media (max-width: 767px) {
[dir] .list-unstyled {
display: block;
}
[dir] .content-box-with-icon-section .content-box {
margin-top: 3rem;
}
}
@keyframes shake-x {
0% {
transform: translate(2px, 1px) rotate(0deg);
}
10% {
transform: translate(-1px, -2px) rotate(-1deg);
}
20% {
transform: translate(-3px, 0) rotate(1deg);
}
30% {
transform: translate(0, 2px) rotate(0deg);
}
40% {
transform: translate(1px, -1px) rotate(1deg);
}
50% {
transform: translate(-1px, 2px) rotate(-1deg);
}
60% {
transform: translate(-3px, 1px) rotate(0deg);
}
70% {
transform: translate(2px, 1px) rotate(-1deg);
}
80% {
transform: translate(-1px, -1px) rotate(1deg);
}
90% {
transform: translate(2px, 2px) rotate(0deg);
}
100% {
transform: translate(1px, -2px) rotate(-1deg);
}
}
@media (max-width: 480px) {
.products-grid,
.categories-style-1 {
grid-template-columns: repeat(2, 1fr);
}
.content-box-with-icon-section .grid-3 {
grid-template-columns: repeat(3, 1fr);
grid-column-gap: 0.625rem;
}
[dir] .category-item .category-details {
padding: 0.75rem 0;
text-align: center;
border-top: 1px solid #f0f0f0;
}
.content-box-with-icon-section .title {
font-weight: 600;
font-size: 0.8125rem;
}
.content-box-with-icon-section .description {
font-size: 0.75rem;
word-break: break-word;
}
.content-box-with-icon-section .icon {
display: block;
height: 2.8125rem;
width: 2.8125rem;
line-height: 2.8125rem;
font-size: 1.5625rem;
}
.products-grid .product-item .product-actions .button {
min-width: 100%;
}
.footer .grid-3 {
grid-template-columns: repeat(3, 1fr);
}
}
</style>
<!--? Product Card Styling -->
<style>
.product-item .product-details {
border-top: none !important;
}
.product-item .product-details .product-info .product-price {
height: 50px;
}
@media only screen and (max-width: 480px) {
.product-item .product-details .product-info .product-title a {
font-size: 13px;
}
}
.product-item {
border: 0.2px solid var(--border-color) !important;
/* box-shadow: 0 2.4rem 4rem rgba(0, 0, 0, 0.075) !important; */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
padding-bottom: 20px;
}
</style>
<!--? Columns Styling -->
<style data-youcan="">
.multi-column-1107 {
padding: 24px 0;
margin-top: 40px;
margin-bottom: 50px;
background-color: #ffffffff;
color: #000000ff;
}
@media screen and (min-width: 1024px) {
.multi-column-1107 {
padding: 32px 0;
}
}
.multi-column-1107 .yc-section-title {
text-align: center;
font-weight: 700;
font-size: 26px;
margin: 0 0 20px;
}
.multi-column-1107 .multi-column-blocks {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 2vw;
align-items: stretch;
}
.column-block {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.column-block .column-title {
margin-top: 16px;
font-weight: 700;
font-size: 18px;
color: #000000ff;
}
.column-block .column-description {
margin: 12px auto;
font-size: 15px;
color: #000000ff;
font-weight: 400;
line-height: 24px;
}
.column-block .column-image {
object-fit: contain;
aspect-ratio: 1;
width: 100%;
height: 100%;
}
.column-image-wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 75px;
height: 75px;
}
.column-image-wrapper svg {
object-fit: contain;
aspect-ratio: 1;
width: 50px;
height: 50px;
}
@media only screen and (max-width: 576px) {
.multi-column-1107 .multi-column-blocks {
grid-template-columns: repeat(2, 1fr);
align-items: start;
row-gap: 16px;
}
.column-block .column-title {
font-size: 15px;
}
.column-image-wrapper {
width: 75px;
height: 75px;
}
}
</style>
<!--? Products images Styling -->
<style>
/* Initial style for the image */
.column-image.fr-fil.fr-dib {
transition: transform 0.3s ease; /* Smooth transition */
}
/* Zoom effect on hover */
.column-image.fr-fil.fr-dib:hover {
transform: scale(1.2); /* Zoom in by 20% */
}
</style>
<!--? Product page Styling -->
<style>
/* Styling the price section */
.product-section.price-section {
display: flex;
justify-content: center;
background: #fff !important;
width: fit-content;
height: fit-content;
}
.product-section.price-section .single-price {
display: flex;
justify-content: center;
gap: 15px;
}
/* Styling the discount element */
.discount_prcnt {
margin: 0;
display: inline-block;
}
/* Styling the product title */
.single-product .single-title {
text-align: center;
}
@media only screen and (max-width: 480px) {
.product-item .product-details .product-info .product-title div {
margin-top: 10px;
}
}
/* Styling the product description */
.single-description.fr-view p {
text-align: center;
}
[dir] .description-section {
padding: 5px;
}
</style>
<!--? Pictures sliding and Size Buttons Styling -->
<style>
.slick-arrow {
border: 0.7px solid black !important;
}
.textual-button {
border: 0.8px solid black;
border-radius: 3px;
}
</style>
<!--? Variants Styling -->
<style>
.product-section.single-variants {
margin-top: 15px !important;
margin-bottom: 15px !important;
display: flex;
align-items: center;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.radio-buttons-container {
font-weight: bold;
padding: 8px 8px;
border-style: solid;
border-width: 3px;
border-color: var(--primary-color);
border-radius: 10px;
background-color: #f5f5f5;
position: relative;
top: -52px;
margin-bottom: -49px;
}
</style>
<!--? Checkout Form Styling -->
<style>
#express-checkout-form {
padding: 15px 15px;
border: 1px solid var(--border-color);
border-radius: 7px;
/* box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1); */
box-shadow: 0 2.4rem 4.8rem rgba(0, 0, 0, 0.075);
background-color: var(--form-background);
}
/* Styling input fields */
[dir] input[type="email"],
[dir] input[type="number"],
[dir] input[type="password"],
[dir] input[type="search"],
[dir] input[type="tel"],
[dir] input[type="text"],
[dir] input[type="url"],
[dir] textarea {
border-radius: 3px;
border: 1px solid var(--border-color);
padding: 10px 15px;
background-color: #fafafa;
}
/* Styling the select field */
[dir]
.checkout-section
.checkout
.main
.checkout-form
.checkout-select
select {
border: 1px solid var(--border-color);
background-color: #fafafa;
}
/* Styling the chekout form heading */
.checkout-section .checkout .main .checkout-form .checkout-heading {
font-weight: 900;
color: var(--primary-color);
text-align: center;
}
</style>
<!--? Form group inputs and responsive text size Styling -->
<style>
.form-group input,
.form-group select {
margin-top: 10px; /* Adjust the top margin as needed */
text-align: center;
}
.new-field-text {
font-weight: bold;
/*color: red;*/
margin-top: 5px; /* Add some space at the top of the span */
}
/* Font size for larger screens */
@media (min-width: 768px) {
.new-field-text {
font-size: 18px; /* Larger font size for bigger screens */
}
}
/* Font size for smaller screens */
@media (max-width: 767px) {
.new-field-text {
font-size: 16px; /* Smaller font size for mobile screens */
}
}
</style>
<!--? Hiding fields while keeping their space inline Styling -->
<style>
.hidden-field {
display: inline !important; /* Make sure they occupy space inline */
visibility: hidden !important; /* Keep them hidden but still take up space */
}
</style>
<!--? Checkout group fields Styling -->
<style>
.form-group {
text-align: center;
}
@media (max-width: 425px) {
.checkout-section
.checkout
.main
.checkout-form
.checkout-groups
.form-group {
flex-basis: 50% !important; /* Reduces the form-group width to 50% on smaller screens */
font-size: 13px !important;
text-align: center;
}
[dir="rtl"]
.checkout-section
.checkout
.main
.checkout-form
.checkout-select
select {
padding: 9px 15px 8px 23px !important;
}
}
</style>
<!--? Quantity and molakhas Header container with responsive adjustments Styling -->
<style>
.quantity-molakhasHeader-container {
display: flex;
text-align: center;
flex-direction: column;
align-items: center;
margin-top: -33px;
}
@media (max-width: 767px) {
.quantity-molakhasHeader-container {
margin-top: -33px;
}
}
.quantity-molakhasHeader-container p {
margin-bottom: 10px; /* Adjust margin if necessary */
margin-right: 0px !important;
}
.quantity {
display: flex;
gap: 10px; /* Add space between the quantity buttons */
}
</style>
<!--? Quantity handler and plus button disabled state Styling -->
<style>
/* Optional: Add CSS to visually indicate disabled state */
.quantity-handler.disabled {
pointer-events: none;
opacity: 0.5;
}
.yc-plus.disabled {
color: gray;
}
</style>
<!--? Quantity Button Styling -->
<style>
/* General container styling */
.checkout .quantity {
display: flex;
align-items: center;
justify-content: center;
background-color: var(--form-background);
border-color: var(
--form-background
); /* Matches the bottom section's background */
padding: 10px;
padding-top: 0px;
border-radius: 5px;
margin-top: 0px; /* Adjust as needed to add spacing */
margin-right: 9px;
width: 100px;
}
/* Styling for the quantity input */
.checkout .quantity input.single-quantity {
width: 50px;
height: 40px;
text-align: center;
border: 1px solid var(--form-background);
border-radius: 4px;
border-color: var(--form-background);
margin: 0; /* Spacing between buttons and input */
padding: 0 2px;
font-size: 16px;
font-weight: bold;
background-color: var(--form-background);
}
/* Styling for the left and right handlers (plus and minus buttons) */
.checkout .quantity-handler {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 25px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: var(--border-color);
cursor: pointer;
transition: background-color 0.3s ease;
}
.checkout .quantity-handler:hover {
background-color: var(--primary-color); /* Slight hover effect */
}
/* Styling for the icon inside the handler */
.checkout .quantity-handler i {
font-size: 18px;
color: #fff;
}
.yc-plus:before {
margin-right: 2px;
margin-left: 2px;
}
.yc-minus:before {
margin-right: 2px;
margin-left: 2px;
}
</style>
<!--? Molakhas Talabya Styling -->
<style>
.checkout-form {
margin-bottom: 10px;
}
#productprice,
#tarifWilayaContainer,
#total {
display: flex; /* Use flexbox to arrange the child elements */
justify-content: space-between; /* Distribute space between the elements */
align-items: center; /* Center align the elements vertically */
direction: rtl; /* Right-to-left direction to have h5 on the right */
/*margin-bottom: 10px; */
/*padding-left: 7px;*/
/*padding-right: 7px;*/
padding: 7px;
}
#total {
font-weight: bold;
}
@media (max-width: 425px) {
.reduce-size {
font-size: 13px !important;
}
}
h6 {
font-size: 1.2em;
padding-left: 2px;
}
h5 {
font-size: 1.1em;
padding-right: 2px;
}
#molakhasContainer {
background-color: var(--form-background);
border-radius: 9px;
border: 1px solid var(--border-color);
/*padding: 5px 0;*/
}
#tarifWilayaContainer {
border-bottom: 1px solid var(--border-color);
}
#total h6 {
color: var(--primary-color);
}
</style>
<!--? Submit Button Styling -->
<style>
/* Styling the order button */
.button.single-submit {
animation-delay: 0s; /* Delay before the animation starts */
animation-direction: normal; /* Play animation in the normal direction */
animation-duration: 2s; /* Duration of the animation cycle */
animation-fill-mode: none; /* No style changes after animation ends */
animation-iteration-count: infinite; /* Repeat the animation infinitely */
animation-name: vibre; /* Use the vibre keyframe animation */
animation-play-state: running; /* Animation is running */
animation-timing-function: linear; /* Constant speed throughout the animation */
border-radius: 0.5rem !important;
}
/* Define the keyframes for the vibre animation */
@keyframes vibre {
0%,
100% {
transform: translateX(0); /* Start at the original position */
}
20%,
60% {
transform: translateX(-2px); /* Move left slightly */
}
40%,
80% {
transform: translateX(2px); /* Move right slightly */
}
}
/* Styling the border radius of the buttons */
[dir] .button {
border-radius: 9px !important;
}
</style>
<!--? Footer Styling -->
<style>
@media only screen and (max-width: 480px) {
.footer .footer-item h3 {
font-size: 13px;
}
}
</style>
<!--? Social media icons on small screen devices Styling -->
<style>
/* Styling for phones */
@media only screen and (max-width: 767px) {
ul.list-unstyled.footer-social {
display: flex;
}
}
</style>
<!--? Hiding the Heading Description -->
<style>
#related-products .container .app-heading .heading-description {
display: none;
}
</style>
<!--? Hiding the Thank u page text -->
<style>
.fr-view p::after {
content: "";
display: none;
}
</style>
<!--? Hiding the single order element -->
<style>
.single-order {
display: none !important;
}
</style>
<script>
ult ولا stopImmediatePropagation
}
btn.dataset.orderProtectionAttached = "1";
});
}
document.addEventListener("DOMContentLoaded", initProtection);
const obs = new MutationObserver(initProtection);
obs.observe(document.documentElement || document.body, { childList: true, subtree: true });
})();
</script>
<style>
/* 1. خلفية بيضاء للصفحة */
body {
background-color: #ffffff !important;
}
/* 2. إطارات برتقالية للعناصر */
#express-checkout-form {
border: 2px solid #ff8c00 !important;
background-color: #ffffff !important;
}
.product-item {
border: 2px solid #ff8c00 !important;
}
.quantity-molakhasHeader-container {
border: 2px solid #ff8c00 !important;
}
#molakhasContainer {
border: 2px solid #ff8c00 !important;
background-color: #ffffff !important;
}
/* إطارات الحقول برتقالية */
[dir] input[type="email"],
[dir] input[type="number"],
[dir] input[type="password"],
[dir] input[type="search"],
[dir] input[type="tel"],
[dir] input[type="text"],
[dir] input[type="url"],
[dir] textarea {
border: 2px solid #ff8c00 !important;
}
[dir] .checkout-section .checkout .main .checkout-form .checkout-select select {
border: 2px solid #ff8c00 !important;
}
/* 3. حذف سعر المنتج */
#productprice {
display: none !important;
}
/* 4. السعر الإجمالي في الأعلى مع تثبيت - سطر واحد - تم إنزاله إلى 60px */
#total {
position: fixed !important;
top: 60px !important; /* تم تغييره من 30px إلى 60px */
left: 50% !important;
transform: translateX(-50%) !important;
background: rgba(255, 255, 255, 0.95) !important;
color: #666666 !important;
padding: 8px 20px !important;
text-align: center !important;
font-size: 14px !important;
font-weight: bold !important;
z-index: 9999 !important;
margin: 0 !important;
border-radius: 20px !important;
border: 1px solid #dddddd !important;
box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
height: auto !important;
min-width: 200px !important;
backdrop-filter: blur(5px) !important;
white-space: nowrap !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
gap: 5px !important;
}
/* 5. حذف عنوان "ملخص الطلبية" */
#molakhas {
display: none !important;
}
/* 6. حذف عنوان "استمارة الطلب" */
.checkout-heading {
display: none !important;
}
/* تعديل المساحة العلوية للعناصر الأخرى */
.slideshow-container {
margin-top: 100px !important; /* تم زيادته من 70px إلى 100px */
}
.header-wrapper {
margin-top: 100px !important; /* تم زيادته من 70px إلى 100px */
}
/* إطارات الأزرار برتقالية */
.button.single-submit {
border: 2px solid #ff8c00 !important;
background-color: #ff8c00 !important;
color: white !important;
}
.checkout .quantity-handler {
background-color: #ff8c00 !important;
border: 2px solid #ff8c00 !important;
}
/* تعديل ألوان العناصر الأخرى لتناسب التصميم الجديد */
.discount_prcnt {
background-color: #ff8c00 !important;
}
.discount_badge {
background-color: #ff8c00 !important;
}
/* إطارات الصور برتقالية */
.product-thumbnail img {
border: 2px solid #ff8c00 !important;
border-radius: 5px !important;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
// 5. حذف عنصر "ملخص الطلبية" تماماً من DOM
const molakhasElement = document.getElementById('molakhas');
if (molakhasElement) {
molakhasElement.remove();
}
// 6. حذف عنوان "استمارة الطلب"
const checkoutHeading = document.querySelector('.checkout-heading');
if (checkoutHeading) {
checkoutHeading.remove();
}
// 4. تحديث السعر الإجمالي بشكل صحيح
function updateTotalPrice() {
getProductPriceDetails();
const unitPrice = parseFloat(price) || 0;
const quantity = parseInt(document.querySelector(".single-quantity")?.value) || 1;
const productTotal = unitPrice * quantity;
const wilaya = document.querySelector("select[name='" + nameWilaya + "']")?.value;
let shipElement = document.querySelector("#tarifWilayaContainer > h6");
let totalPrice = productTotal;
let displayText = "المبلغ الإجمالي: " + productTotal + " د.ج";
// إذا تم اختيار الولاية وأضيف سعر التوصيل
if (shipElement && wilaya) {
let shipText = shipElement.textContent;
function containsNumbers(str) {
return /\d/.test(str);
}
if (containsNumbers(shipText) || shipText === "التوصيل مجاني") {
let shippingPrice = parseInt(shipText) || 0;
totalPrice = productTotal + shippingPrice;
if (shipText === "التوصيل مجاني") {
displayText = "المبلغ الإجمالي: " + productTotal + " د.ج (التوصيل مجاني)";
} else {
displayText = "المبلغ الإجمالي: " + totalPrice + " د.ج";
}
}
}
// تحديث السعر الإجمالي في الأعلى
const totalElement = document.querySelector("#total");
if (totalElement) {
totalElement.innerHTML = '<span style="font-size: 14px; color: #666666; font-weight: bold;">' + displayText + '</span>';
}
// تحديث الحقل المخفي
if (totalPriceInput) {
totalPriceInput.value = totalPrice;
}
}
// إضافة مستمعات الأحداث لتحديث السعر
const wilayaSelect = document.querySelector("select[name='" + nameWilaya + "']");
const deliverySelect = document.querySelector("select[name='" + deliveryOption + "']");
const quantityInput = document.querySelector(".single-quantity");
if (wilayaSelect) {
wilayaSelect.addEventListener('change', updateTotalPrice);
}
if (deliverySelect) {
deliverySelect.addEventListener('change', updateTotalPrice);
}
if (quantityInput) {
quantityInput.addEventListener('input', updateTotalPrice);
quantityInput.addEventListener('change', updateTotalPrice);
}
// إضافة مستمعات لأزرار الكمية
const plusButton = document.querySelector(".quantity-handler-right");
const minusButton = document.querySelector(".quantity-handler-left");
if (plusButton) {
plusButton.addEventListener('click', function() {
setTimeout(updateTotalPrice, 100);
});
}
if (minusButton) {
minusButton.addEventListener('click', function() {
setTimeout(updateTotalPrice, 100);
});
}
// تحديث أولي للسعر - يعرض سعر المنتج فقط في البداية
setTimeout(function() {
getProductPriceDetails();
const unitPrice = parseFloat(price) || 0;
const quantity = parseInt(document.querySelector(".single-quantity")?.value) || 1;
const productTotal = unitPrice * quantity;
const totalElement = document.querySelector("#total");
if (totalElement) {
totalElement.innerHTML = '<span style="font-size: 14px; color: #666666; font-weight: bold;">المبلغ الإجمالي: ' + productTotal + ' د.ج</span>';
}
// تحديث دوري للتأكد من ظهور السعر الصحيح
setInterval(updateTotalPrice, 3000);
}, 1500);
});
</script>