2016-12-19 3 views
1

У меня проблема с доставкой woocommerce, вот ошибка, которую я получаю на странице корзины.FATAL ERROR get_label() woocommerce shipping

Fatal error: Call to a member function get_label() on null in public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 327 

Скриншот также прилагается. enter image description here

туалет телега-functions.php

function wc_cart_totals_shipping_method_label($method) { 
    $label = $method->get_label(); 

    if ($method->cost > 0) { 
     if (WC()->cart->tax_display_cart == 'excl') { 
      $label .= ': ' . wc_price($method->cost); 
      if ($method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax) { 
       $label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>'; 
      } 
     } else { 
      $label .= ': ' . wc_price($method->cost + $method->get_shipping_tax()); 
      if ($method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax) { 
       $label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>'; 
      } 
     } 
    } 

    return apply_filters('woocommerce_cart_shipping_method_full_label', $label, $method); 
} 

get_label()

public function get_label() { 
     return apply_filters('woocommerce_shipping_rate_label', $this->label); 
    } 

Любая помощь будет высоко оценен.

+0

можете ли вы скопировать часть кода, вызывающего проблему? возможно, как линия 320 до строки 335 –

+0

вопрос обновлен – Kevin

+0

поиск файлов woocommerce и найти тело get_label() –

ответ

0

Используйте add_filter вместо apply_filters в функции get_label(). Это решит вашу проблему.

Смежные вопросы