• ovidijusk

    (@ovidijusk)


    Hello, we found a bug in plugin file compatibility/TableRateShipping/OrderItems/ShippingRate.php

    Line 54: $shippingInstanceId sometimes is returned as string and causes fatal php error in orders grid because get_shipping_rates function expects integer.

        $shippingInstanceId = $item->get_instance_id();
    $ratesPerInstance = \WooCommerce\Shipping\Table_Rate\Helpers::get_shipping_rates($shippingInstanceId, ARRAY_A );


    PHP Fatal error: Uncaught TypeError: WooCommerce\Shipping\Table_Rate\Helpers::get_shipping_rates(): Argument #1 ($instance_id) must be of type int, string given, called in ***/wp-content/plugins/woocommerce-multilingual/compatibility/TableRateShipping/OrderItems/ShippingRate.php on line 55 and defined in /***/wp-content/plugins/woocommerce-table-rate-shipping/includes/class-helpers.php:40

    Could you fix it in next plugin release?

    Best regards,
    Ovidijus.

Viewing 1 replies (of 1 total)
  • Plugin Author Pierre Sylvestre

    (@strategio)

    Hi @ovidijusk,

    Thanks for reporting this error, we’ll fix it in our next WCML version.

    Meanwhile, you can just cast the the variable to an integer (as you probably already did):

    $ratesPerInstance = \WooCommerce\Shipping\Table_Rate\Helpers::get_shipping_rates( (int) $shippingInstanceId, ARRAY_A );

    Internal ref: wcml-5227

    Thanks,

    Pierre

Viewing 1 replies (of 1 total)

The topic ‘Bug in compatibility with TableRateShipping plugin code’ is closed to new replies.