Plugin Author
Zorem
(@zorem)
I think that the order status is updated to Shipped (Completed) before the tracking info is added. Maybe you can think of any other change in your system? new plugin? new custom code?
Can you share the API call you are doing to update the tracking?
Hello, this is the API call we are doing:
public function handle()
{
try {
$data = [
"tracking_provider" => $this->provider,
"tracking_number" => $this->tracking,
];
if ($this->link) {
$data['tracking_link'] = urlencode($this->link);
}
$shipmentTracking = Woocommerce::post("orders/$this->number/shipment-trackings", $data);
Log::debug("[WooCommerce.job.order.send-shipping-number] update tracking number $this->number order");
} catch (\Exception $exception) {
Log::error($exception->getMessage());
}
}
Plugin Author
Zorem
(@zorem)
Hi, check the API code we provide in the AST shipment tracking API docs, we do not use the tracking link since its coming form the shipping providers list:
Thanks
We have commented this line:
if ($this->link) {
$data['tracking_link'] = urlencode($this->link);
}
But it doesn’t work either. Actually as I said WP is receiving the tracking number correctly, as shown on the WP Admin Orders page.
Plugin Author
Zorem
(@zorem)
Our API endpoint does not offer a tracking link, you add the provider and the tracking link is generated by the shipping providers list. Are you sure you are using the AST plugin?
Yes, we are using the plugin made by zorem.
We can get the tracking link, so we send it I think because the Mail Boxes Etc provider wasn’t added yet. However we have removed this line and the emails still don’t include the tracking number.
Plugin Author
Zorem
(@zorem)
The orders includes the tracking? if yes, it means that somehow you are updating the order status to “Completed” before you add the tracking to the order.
Hello, we have changed it as suggested and now it works. Thank you
Plugin Author
Zorem
(@zorem)
Great! if you like AST, please share your review 🙂