WPML
סטטוס
נפתר
דווח עבור
WPML Multilingual & Multicurrency for WooCommerce 5.3.7
נפתר בגרסה
WooCommerce Multilingual & Multicurrency 5.4.0
תוסף/ערכת עיצוב קשורים
WooCommerce Bookings
תגיות נושא
Compatibility, WCML

סקירה כללית של התקלה

מתרחשת שגיאה חמורה בעת ביטול הזמנה ב־WooCommerce Bookings אם משאב ההזמנה אינו מתורגם:

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

פתרון עוקף

אנא ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.


  • פתח את הקובץ …/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/class-wcml-bookings.php.

  • חפש את שורה 937.

  • החלף את:
    		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 = '';
    			}
    		}


  • בטקסט הבא:
    		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;
    			}
    		}


  • לאחר מכן, חפש את שורה 956.

  • החלף את:
    			if ( is_null( $trnsl_booking_resource_id ) ) {
    				$trnsl_booking_resource_id = '';
    			}


  • בטקסט הבא:
    			if ( is_null( $trnsl_booking_resource_id ) ) {
    				$trnsl_booking_resource_id = $booking_resource_id;
    			}

כל התקלות הידועות →