- الحالة
- محلولة
- أُبلغ عنها لـ
- WPML Multilingual & Multicurrency for WooCommerce 5.1.3
- تم حلها في
- WCML 5.2.0
- الإضافة/القالب ذو الصلة
- Avada
- وسوم الموضوع
- Compatibility
نظرة عامة على المشكلة
عند استخدام Avada +7.10 مع WPML متعدد اللغات وتعدد العملات لـ WooCommerce، يحدث الخطأ الفادح التالي إذا حاولت إنشاء صفحة باستخدام Live Editor الخاص بـ Avada.
PHP Fatal error: Uncaught Error: Call to a member function get_id() on bool in ../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-orders.php:481
حل بديل مؤقت
يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح الملف …/wp-content/plugins/woocommerce/includes/class-wc-order-item-product.php.
- ابحث عن السطر 403.
- استبدل هذا السطر:
return apply_filters( 'woocommerce_get_item_downloads', $files, $this, $order );
بـ:// WPML workaround for compsupp-6711 if ( class_exists('Sitepress') && ! is_object($order) ) { global $woocommerce_wpml; if ( $woocommerce_wpml && isset( $woocommerce_wpml->orders ) ) { $removed = remove_filter( 'woocommerce_get_item_downloads', [ $woocommerce_wpml->orders, 'filter_downloadable_product_items' ], 10 ); } } $result = apply_filters( 'woocommerce_get_item_downloads', $files, $this, $order ); // Maybe restore the filter if ( $removed ) { add_filter( 'woocommerce_get_item_downloads', [ $woocommerce_wpml->orders, 'filter_downloadable_product_items' ], 10, 3 ); } return $result;