Pular a navegação

Open

Reported for: WooCommerce Multilingual & Multicurrency 5.3.7

Topic Tags: Compatibility, WCML

Overview of the issue

A fatal error occurs when canceling a booking in WooCommerce Bookings if the booking resource is not translated:

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

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/class-wcml-bookings.php file.
  • Look for line 937.
  • Replace:
    		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 = '';
    			}
    		}
    
  • With:
    		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;
    			}
    		}
    
  • Then, look for line 956.
  • Replace:
    			if ( is_null( $trnsl_booking_resource_id ) ) {
    				$trnsl_booking_resource_id = '';
    			}
    
  • With:
    			if ( is_null( $trnsl_booking_resource_id ) ) {
    				$trnsl_booking_resource_id = $booking_resource_id;
    			}
    

Deixar uma Resposta

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

Você pode usar estas tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>