Fortnox - 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.
Before Product Sync
Action: 'obj_fortnox_before_sync_product'
Parameters:
$product_id
ID of the product being synced
Description: Fired when a product is going to be synced
After Product Sync
Action: 'obj_fortnox_after_sync_product'
Parameters:
$product_id
ID of the product that was synced
$new_article
Entire response object from the request, This contains the Fortnox-article.
Description: Fired when a product was synced to Fortnox
Before Updated Product Sync
Action: 'obj_fortnox_before_sync_updated_product'
Parameters:
$product_id
ID of the product that was updated
Description: Fired when a product was updated. This happens before validation of settings are done.
After Updated Product Sync
Action: 'obj_fortnox_after_sync_updated_product'
Parameters:
$product_id
ID of the product that was updated
$new_article
Entire response object from the request, This contains the Fortnox-article.
Description: Fired when a product was updated.
Before Guest User Sync
Action: 'obj_fortnox_before_sync_guser'
Parameters:
$order_id
ID of the order that is connected to the guest-user.
Description: Fired before we create a new user in Fortnox
After Guest User Sync
Action: 'obj_fortnox_after_sync_guser'
Parameters:
$order_id
ID of the order that is connected to the guest-user.
$new_customer
Entire response object from the request, This contains the Fortnox-Response.
Description: Fired after we create a new user in Fortnox
Before Update Guest User
Action: 'obj_fortnox_before_update_sync_guser'
Parameters:
$order_id
ID of the order that is connected to the guest-user.
Description: Fired before we update guest-user in Fortnox
After Update Guest User
Action: 'obj_fortnox_after_update_sync_guser'
Parameters:
$order_id
ID of the order that is connected to the guest-user.
$new_customer
Entire response object from the request, This contains the Fortnox-Response.
Description: Fired after we update guest-user in Fortnox
Before User Sync
Action: 'obj_fortnox_before_sync_user'
Parameters:
$user_id
ID of the userthat is going to be synced.
Description: Fired before we create a new user in Fortnox
After User Sync
Action: 'obj_fortnox_after_sync_user'
Parameters:
$user_id
ID of the user that was just synced to Fortnox.
$new_customer
Entire response object from the request, This contains the Fortnox-Response.
Description: Fired after we create a new user in Fortnox
Before Update User
Action: 'obj_fortnox_before_update_sync_user'
Parameters:
$user_id
ID of the user that maybe will be updated.
Description: Fired before we update user in Fortnox
After Update User
Action: 'obj_fortnox_after_update_sync_user'
Parameters:
$user_id
ID of the user that was updated.
$new_customer
Entire response object from the request, This contains the Fortnox-Response.
Description: Fired after we update guest-user in Fortnox
Before Create Offer
Action: 'obj_fortnox_before_sync_offer'
Parameters:
$order_id
ID of the Order that should be turned into an offer in Fortnox
Description: Fired when a call to Fortnox is going to happen
After Create Offer
Action: 'obj_fortnox_after_sync_offer'
Parameters:
$order_id
ID of the Order that should be turned into an offer in Fortnox
$new_offer
Object containing the response from Fortnox
Description: Fired when a call to Fortnox has happened
Before Create Order from Offer
Action: 'obj_fortnox_before_create_offer_order'
Parameters:
$order_id
ID of the Order that should be turned into an order in Fortnox
Description: Fired when a call to Fortnox has happened
After Create Order from Offer
Action: 'obj_fortnox_after_create_offer_order'
Parameters:
$order_id
ID of the Order that have been turned into an order in Fortnox
Description: Fired when a call to Fortnox has happened
Before Order is synced
Action: 'obj_fortnox_before_sync_order'
Parameters:
$order_id
ID of the Order that are going to be synced
Description: Fired when a call to Fortnox is going to happen
After Order is synced
Action: 'obj_fortnox_after_sync_order'
Parameters:
$order_id
ID of the Order that are going to be synced
$new_order
Object containing the response from Fortnox
Description: Fired when a call to Fortnox has happend
Before we cancel an Order
Action: 'obj_fortnox_before_sync_canceled_order'
Parameters:
$order_id
ID of the Order that are going to be canceled
Description: Fired when a call to Fortnox is going to happen
After Order was Canceled
Action: 'obj_fortnox_after_sync_canceled_order'
Parameters:
$order_id
ID of the Order that was canceled
Description: Fired when a call to Fortnox is going to happen