Support » Plugin: WooCommerce - Table Rates » Error if “Local Countries” is void

  • If I leave void the “Local Countries” I have a error(see below).

    I Found the line and the solution can be is:

    Go to file woocommerce-table-rates/includes/class.tablerate.php on 187 line and change:

      if ( $localCountry == '' )
           $localCountry[] = $woocommerce->countries->get_base_country();


      if ( $localCountry == '' ){
           $localCountry = array();
           $localCountry[] = $woocommerce->countries->get_base_country();


    2017/08/23 13:37:32 [error] 3053#3053: *48197 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /home/forge/
    Stack trace:
    #0 /home/forge/ rp_tablerates->calculate_shipping(Array)
    #1 /home/forge/ WC_Shipping_Method->get_rates_for_package(Array)
    #2 /home/forge/ WC_Shipping->calculate_shipping_for_package(Array, 0)
    #3 /home/forge/ WC_Shipping->calculate_shipping(Array)
    #4 /home/forge/ WC_Cart->calculate_shipping()
    #5 /home/forge/" while reading upstream, client:, server:, request: "GET /es/cart/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "", referrer: ""

    If you add me as contributor I will fix that and other issues, Thanks.

    Jose Carlos Ramos Carmenates

  • The topic ‘Error if “Local Countries” is void’ is closed to new replies.