탐색 건너뛰기

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;
    			}
    

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>