- الحالة
- مفتوحة
- أُبلغ عنها لـ
- WPML Multilingual & Multicurrency for WooCommerce 5.3.2
- وسوم الموضوع
- Bug
نظرة عامة على المشكلة
حالياً، قد تظهر ملاحظة الطلب المضافة تلقائياً بعد عملية الشراء الأولى باللغة التي تم بها الطلب، بدلاً من لغة لوحة التحكم الافتراضية. تقتصر هذه المشكلة على الحالات التي يكمل فيها المستخدم عملية الشراء بـ لغة ثانوية.
حل بديل مؤقت
يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح ملف functions.php الخاص بقالبك.
- أضف المقتطف التالي:
// The action is added only once, we are removing it just after it's called. // The same happens for the hook to restore the language once the note is added. $temporarilySwitchToDefaultLang = function() use ( &$temporarilySwitchToDefaultLang ) { add_action( 'woocommerce_order_status_processing', $temporarilySwitchToDefaultLang ); do_action( 'wpml_switch_language', apply_filters( 'wpml_default_language', null ) ); $restoreLang = function() use ( &$restoreLang ) { remove_action( 'woocommerce_order_note_added', $restoreLang ); do_action( 'wpml_switch_language', null ); }; add_action( 'woocommerce_order_note_added', $restoreLang ); }; add_action( 'woocommerce_order_status_processing', $temporarilySwitchToDefaultLang );