DIY sync

WooCommerce KROS Onix Connector


Zoznam action a filter hookov podporovaných pluginom WooCommerce KROS Onix Connector. Uvedené hooky môžete používať v šablónach vašich e-shopov pridaním do súboru functions.php alebo použitím pluginu pre snippet hooky.

tlw_wc_onix_conn_sync_order

  • filter hook pre úpravu výstupného poľa s údajmi objednávky smerom z e-shopu do Onixu
/**
 * 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 pre úpravu výstupného poľa s údajmi položky produktu v objednávke alebo faktúre smerom z e-shopu do Onixu
/**
 * 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 pre úpravu výstupného poľa s údajmi položky extra poplatku v objednávke alebo faktúre smerom z e-shopu do Onixu
/**
 * 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 pre úpravu výstupného poľa s údajmi položky dopravy v objednávke alebo faktúre smerom z e-shopu do Onixu
/**
 * 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 pre úpravu výstupného poľa s údajmi faktúry smerom z e-shopu do Onixu
/**
 * 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 pre úpravu vstupného poľa s údajmi jednoduchého alebo variabilného produktu smerom z Onixu do e-shopu
/**
 * 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 pre úpravu vstupného poľa s údajmi variantu produktu smerom z Onixu do e-shopu
/**
 * 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 pre úpravu vstupného poľa s údajmi obrázka produktu smerom z Onixu do e-shopu
/**
 * 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 pre úpravu vstupného URI stringu pre získanie partnerov z Onixu do e-shopu
/**
 * 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 pre úpravu vstupného poľa s údajmi zákazníka smerom z Onixu do e-shopu
/**
 * 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 volaný po vykonaní synchronizácie zákazníka z Onixu do e-shopu
/**
 * 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);