dpdconnect/woocommerce-shipping

Order properties should not be accessed directly - $order->currency

Closed this issue · 1 comments

PHP Notice: currency was called <strong>incorrectly</strong>. Order properties should not be accessed directly. Backtrace: edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, DpdConnect\classes\Handlers\GenerateLabelBox::process, DpdConnect\classes\Handlers\LabelRequest::single, DpdConnect\classes\OrderTransformer->createShipment, DpdConnect\classes\OrderTransformer->addCustomsToShipment, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.0.) in /var/www/sites/www.re-enactmentshop.com/web/wp-includes/functions.php on line 5775

In function addCustomsToShipment from class OrderTransformer (line 133), the currency is called directly
'totalCurrency' => $order->currency,

This should be:
$order->get_currency()

Fixed from version 1.3.5.