document.addEventListener('DOMContentLoaded', function () {
// نام - 15 کاراکتر
document.querySelector('#billing_first_name')?.setAttribute('maxlength', '15');
// نام خانوادگی - 20 کاراکتر
document.querySelector('#billing_last_name')?.setAttribute('maxlength', '20');
// نام شرکت - 20 کاراکتر
document.querySelector('#billing_company')?.setAttribute('maxlength', '20');
// خیابان 1 و 2 - هر کدام 100 کاراکتر
document.querySelector('#billing_address_1')?.setAttribute('maxlength', '100');
document.querySelector('#billing_address_2')?.setAttribute('maxlength', '100');
// شماره موبایل و کد پستی - فقط عدد و 10 رقم
// const numericFields = ['#billing_phone', '#billing_postcode'];
// numericFields.forEach(selector => {
// const el = document.querySelector(selector);
// if (el) {
// el.setAttribute('maxlength', '10');
// el.setAttribute('inputmode', 'numeric');
// el.addEventListener('input', function () {
// this.value = this.value.replace(/\D/g, '').slice(0, 10);
//});
//}
//});
// یادداشت سفارش - 100 کاراکتر
document.querySelector('#order_comments')?.setAttribute('maxlength', '200');
});