WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
WPML Multilingual & Multicurrency for WooCommerce 5.1.3
Đã giải quyết trong
WCML 5.2.0
Plugin/giao diện liên quan
Avada
Thẻ chủ đề
Compatibility

Tổng quan về lỗi

Khi sử dụng Avada +7.10 với WPML Đa ngôn ngữ & Đa tiền tệ cho WooCommerce, lỗi nghiêm trọng sau sẽ xảy ra nếu bạn cố gắng tạo một trang bằng Live Editor của 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

Giải pháp tạm thời

Vui lòng đảm bảo tạo bản sao lưu đầy đủ cho trang web của bạn trước khi tiếp tục.


  1. Mở tệp …/wp-content/plugins/woocommerce/includes/class-wc-order-item-product.php.

  2. Tìm dòng 403.

  3. Thay thế dòng này:
    return apply_filters( 'woocommerce_get_item_downloads', $files, $this, $order );
    Bằng:
    // 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;

Tất cả các lỗi đã ghi nhận →