WPML
상태
해결됨
보고된 제품
WPML Multilingual & Multicurrency for WooCommerce 4.8.0
해결된 버전
WooCommerce Multilingual 4.9.0-b1

문제 개요

YITH Affiliate, YITH Giftcards, WCFM 플러그인 및 기타 일부 플러그인에서 이메일을 보낼 때 다음과 같은 오류가 발생할 수 있습니다:

PHP Fatal error:  Uncaught Error: Call to a member function get_id() on array in /public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php:395

임시 해결 방법

개발팀에서 이 문제를 해결하기 위해 작업 중입니다.
임시 해결 방법으로, 사이트를 전체 백업했는지 확인한 후에만 wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php로 이동하여 코드를:

	public function get_email_translated_string( $key,
			$object, $language)
		{

		$context = 'admin_texts_woocommerce_' . $object->id . '_settings';
		$name    = '[woocommerce_' . $object->id . '_settings]' . $key;

		return $this->wcml_get_translated_email_string( $context, $name, $object->object->get_id(), $language );

에서 다음 코드로 변경하세요:

public function get_email_translated_string( $key, $object, $language ) {
    $context = 'admin_texts_woocommerce_' . $object->id . '_settings';
    $name = '[woocommerce_' . $object->id . '_settings]' . $key;

    $order_id = false;

    if ( method_exists( $object->object, 'get_id' ) ) {
        $order_id = $object->object->get_id();
    }

    if ( is_array( $object->object ) && isset( $object->object['ID'] ) ) {
        $order_id = $object->object['ID'];
    }

    return $this->wcml_get_translated_email_string( $context, $name, $order_id, $language );
}

알려진 모든 문제 →