nShift - Hooks (Actions)

Hooks in WordPress essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.

Read more about action and filter hooks here:
In Unifaun there are some actions and filters available, mainly for modifying the data sent to Unifaun.

Response Action

Action:   'ac_wc_unifaun_shipment_response_body'

Parameters:
$body Object containing callback data from Unifaun
$response Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order A WC_Order object related to the order.

Description: Fired when a calls to Unifaun was successfully

This action can be used to create custom logic based on response data.

Print Response Action

Action:   'ac_wc_unifaun_shipment_print_response_body'

Parameters:
$body Object containing callback data from Unifaun
$response Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order A WC_Order object related to the order.

Description: Fired when a shipment was completed/printed, $body contains the tracking IDs etc

This action can be used to create custom logic based on response data when a shipment was printed.

Successful Print Action

Action:   'ac_wc_unifaun_shipment_print_successful_print'

Parameters:
$body Object containing callback data from Unifaun
$response Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order A WC_Order object related to the order.

Description: Fired when a shipment was completed/printed after the meta has been saved

This action can be used to create custom logic based on response data when a shipment was printed and after order meta was saved.

Return shipment Response Action

Action:   'ac_wc_unifaun_shipment_return_response_body'

Parameters:
$body Object containing callback data from Unifaun
$response Entire response object from the request, decode this using json_decode( wp_remote_retrieve_body( $response ) )
$order A WC_Order object related to the order.

Description: Fired when a shipment was completed/printed after the meta has been saved

This action can be used to create custom logic based on response data when a return shipment was created.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us