Not compatible with Custom order number plugin.
-
I am using Sequential Order Numbers for WooCommerce in my site and this DHL plugin does not compatible with it. The error happened in this line
Uncaught Error: Call to a member function get_data() ..../plugins/dhl-ecommerce-apac/includes/shippinglabel/class-dhl-apac-shippinglabel.php:63
Upon checking, it was these codes that caused the error
$dhl_order = new WC_Order($post->ID); $dhl_order_id = trim(str_replace('#', '', $dhl_order->get_order_number())); $getOrderproductmname = wc_get_order($dhl_order_id);
The error here is at the
$dhl_order_id
which is get the order number that changed by the Sequential plugin, hence$getOrderproductmname
` will get null.Apart of that, what I think worth mentioned is, I don’t know why you need get the order data twice, since you already get the order in
$dhl_order
, why would you want to get the order again in$getOrderproductmname
? This is too redundant, make extra queries to the server. You can just use$dhl_order
instead, and since it is using the Post ID, you won’t have to deal with the Order Number.Since the plugin doesn’t provide any hooks for customization, and I don’t want to change the source file directly, hope you can fix this issue asap.
Thanks.
- The topic ‘Not compatible with Custom order number plugin.’ is closed to new replies.