Hi @frischi,
To address your first question, you’ll need to contact CJ Dropshipping and request that they modify their REST API to include the parameter “status_shipped” with a value of 0. This will prevent the order status from automatically changing to “completed” when tracking information is transferred via their API. For more details on how to implement this, you can refer to our Shipment Tracking API documentation here: https://docs.zorem.com/docs/ast-free/add-tracking-to-orders/shipment-tracking-api.
Regarding your second question, unfortunately, it is not currently possible to delete the “completed” email in the “Order emails display” settings.
Best Regards,
Gaurav
Ok, thanks. Is it also possible to use an action or filter hook in my wordpress to override this property? Then I would do that.
You can use the ast_api_create_item_arg
filter to modify the arguments passed when creating a shipment tracking item via the API. Here’s a code snippet demonstrating how you can override the status_shipped
parameter to set it to 1:
add_filter( 'ast_api_create_item_arg', 'customize_shipment_tracking_args', 10, 2 );
function customize_shipment_tracking_args( $args, $request ) {
// Change the status_shipped parameter to 1
$args['status_shipped'] = 1;
// Return the modified arguments
return $args;
}
You can add this code snippet to your theme’s functions.php file or a custom plugin. With this filter in place, any tracking items created via the API will have the status_shipped
parameter set to 1, ensuring that the order status does not automatically change to “completed”.
Best Regards,
Gaurav
Thanks. This looks very nice. I will try that.
Sorry, but it is confusing. Does the $args[‘status_shipped’] value really has to be set to 1? Is it not 0 for preventing order status automatically change to “completed”?
Yes, you are correct. To prevent the order status from automatically changing to “completed,” you need to set the value of $args['status_shipped']
to 0, not 1. This ensures that the order remains in its current status and does not transition to “completed” when updating the tracking information.