DIY sync

WooCommerce KROS Onix Connector


List of action and filter hooks supported by the WooCommerce KROS Onix Connector plugin. You can use this hooks in your e-shop templates by adding them to the functions.php file or by using the plugin for snippet hooks.

tlw_wc_onix_conn_sync_order

  • filter hook for modifying the output fields with order data from the e-shop to Onix
/**
 * filter hook for order sync to Onix
 * @param array $order_sync order request output to Onix
 * @param obj $order eshop order data
 * @param array $custom_company_data company billing data
 * @return array final order request output to Onix
 */
add_filter('tlw_wc_onix_conn_sync_order', function($order_sync, $order, $custom_company_data) {
     return $order_sync;
}, 10, 3);

tlw_wc_onix_conn_sync_order_item

  • filter hook for modifying the output fields with product item data in the order or invoice from the e-shop to Onix
/**
 * filter hook for order/invoice product item sync to Onix
 * @param array $order_item order/invoice product item request output to Onix
 * @param obj $item eshop order item data
 * @return array final order/invoice product item request to Onix
 */
add_filter('tlw_wc_onix_conn_sync_order_item', function($order_item, $item) {
     return $order_item;
}, 10, 2);

tlw_wc_onix_conn_sync_order_fee

  • filter hook for modifying the output fields with extra fee item data in the order or invoice from the e-shop to Onix
/**
 * filter hook for order/invoice fee item sync to Onix
 * @param array $order_fee order/invoice fee item request output to Onix
 * @param obj $item eshop order item data
 * @return array final order/invoice fee item request to Onix
 */
add_filter('tlw_wc_onix_conn_sync_order_fee', function($order_fee, $item) {
     return $order_fee;
}, 10, 2);

tlw_wc_onix_conn_sync_order_shipping

  • filter hook for modifying the output fields with shipping item data in the order or invoice from the e-shop to Onix
/**
 * filter hook for order/invoice shipping item sync to Onix
 * @param array $order_shipping order/invoice shipping item request output to Onix
 * @param obj $order eshop order data
 * @return array final order/invoice shipping item request to Onix
 */
add_filter('tlw_wc_onix_conn_sync_order_shipping', function($order_shipping, $order) {
     return $order_shipping;
}, 10, 2);

tlw_wc_onix_conn_sync_invoice

  • filter hook for modifying the output fields with invoice data from the e-shop to Onix
/**
 * filter hook for invoice sync to Onix
 * @param array $invoice_sync invoice request output to Onix
 * @param obj $order eshop order data
 * @return array final invoice request output to Onix
 */
add_filter('tlw_wc_onix_conn_sync_invoice', function($invoice_sync, $order) {
     return $invoice_sync;
}, 10, 2);

tlw_wc_onix_conn_sync_product

  • filter hook for modifying the input fields with simple or variable product data from Onix to the e-shop
/**
 * filter hook for product sync from Onix to eshop
 * @param array $product_eshop product request output to eshop
 * @param obj $product_onix Onix product data
 * @param array $images Onix product images
 * @return array final product request to eshop
 */
add_filter('tlw_wc_onix_conn_sync_product', function($product_eshop, $product_onix, $images) {
     return $product_eshop;
}, 10, 3);

tlw_wc_onix_conn_sync_product_variation

  • filter hook for modifying the input fields with product variant data from Onix to the e-shop
/**
 * filter hook for product variation sync from Onix to eshop
 * @param array $product_variation_eshop product variation request output to eshop
 * @param obj $product_onix Onix product data
 * @param array $images Onix product images
 * @return array final product variation request to eshop
 */
add_filter('tlw_wc_onix_conn_sync_product_variation', function($product_variation_eshop, $product_onix, $images) {
     return $product_variation_eshop;
}, 10, 3);

tlw_wc_onix_conn_get_product_image_base64

  • filter hook for modifying the input fields with product image data from Onix to the e-shop
/**
 * filter hook for getting base64 product image from Onix to eshop
 * @param str $image_base64 base64 encode product image from Onix
 * @param obj $response_img full response of product image from Onix
 * @param obj $image_onix product image meta data from Onix
 * @return base64 string
 */
add_filter('tlw_wc_onix_conn_get_product_image_base64', function($image_base64, $response_img, $image_onix) {
     return $image_base64;
}, 10, 3);

tlw_wc_onix_conn_api_request_get_partners

  • filter hook for modifying the URI string input for getting partners from Onix to the e-shop
/**
 * filter hook for getting of partners from Onix to eshop
 * @param string $request URI request
 * @param string $action sync action
 * @return string final URI request
 */
add_filter('tlw_wc_onix_conn_api_request_get_partners', function($request, $action) {
     return $request;
}, 10, 2);

tlw_wc_onix_conn_sync_customers_to_eshop

  • filter hook for modifying the input fields with customer data from Onix to the e-shop
/**
 * filter hook for sync customer from Onix to eshop
 * @param array $customer_eshop user request output to eshop
 * @param obj $customer_onix Onix customer data
 * @return array final customer request to eshop
 */
add_filter('tlw_wc_onix_conn_sync_customers_to_eshop', function($customer_eshop, $customer_onix) {
     return $customer_eshop;
}, 10, 2);

tlw_wc_onix_conn_sync_customers_to_eshop_user

  • action hook called after synchronization of the customer from Onix to the e-shop
/**
 * action hook for running some action after customer sync from Onix to eshop
 * @param int $user_id eshop user ID
 * @param array $customer user request output to eshop
 * @param array $customer_onix Onix customer data
 * @return void
 */
add_action('tlw_wc_onix_conn_sync_customers_to_eshop_user', function($user_id, $customer, $customer_onix) {
     // your code
}, 10, 3);