- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual & Multicurrency for WooCommerce 5.3.7
- Đã giải quyết trong
- WooCommerce Multilingual & Multicurrency 5.4.0
- Plugin/giao diện liên quan
- WooCommerce Bookings
- Thẻ chủ đề
- Compatibility, WCML
Tổng quan về lỗi
Một lỗi nghiêm trọng xảy ra khi hủy đặt chỗ trong WooCommerce Bookings nếu tài nguyên đặt chỗ không được dịch:
Uncaught Error: Call to a member function get_resource_label() on null in .../wp-content/plugins/woocommerce-bookings/templates/emails/customer-booking-cancelled.php:49
Giải pháp tạm thời
Vui lòng đảm bảo bạn có bản sao lưu toàn bộ trang web của mình trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/class-wcml-bookings.php.
- Tìm dòng 937.
- Thay thế:
if ( $booking_product_id ) { $trnsl_booking_product_id = apply_filters( 'translate_object_id', $booking_product_id, 'product', false, $language ); if ( is_null( $trnsl_booking_product_id ) ) { $trnsl_booking_product_id = ''; } } - Bằng:
if ( $booking_product_id ) { $trnsl_booking_product_id = apply_filters( 'translate_object_id', $booking_product_id, 'product', false, $language ); if ( is_null( $trnsl_booking_product_id ) ) { $trnsl_booking_product_id = $booking_product_id; } } - Sau đó, tìm dòng 956.
- Thay thế:
if ( is_null( $trnsl_booking_resource_id ) ) { $trnsl_booking_resource_id = ''; } - Bằng:
if ( is_null( $trnsl_booking_resource_id ) ) { $trnsl_booking_resource_id = $booking_resource_id; }