Developer filters and actions
If you can’t find a filter or action you need here, contact me with where and how you’d like it added, and I’ll be glad to do so, so that future plugin updates stay safe.
kbnt_messenger_cod_methods
Section titled “kbnt_messenger_cod_methods”The filter returns the slugs of payment methods that are treated as cash on delivery.
apply_filters('kbnt_messenger_cod_methods', ['cod', 'dobirka']);Parameters
Section titled “Parameters”- $methods (array) Slugs of the payment methods treated as cash on delivery.
Source code
Section titled “Source code”The filter is located in the file classes/WooCommerce/Order.php.
kbnt_messenger_max_package_weight
Section titled “kbnt_messenger_max_package_weight”Adjusts the maximum weight of an individual package.
apply_filters('kbnt_messenger_max_package_weight', $weight, $order);Parameters
Section titled “Parameters”- $weight (int) The maximum package weight in kilograms.
- $order (WC_Order) The order.
Source code
Section titled “Source code”The filter is located in the file classes/WooCommerce/Order.php.
kbnt_messenger_order_data
Section titled “kbnt_messenger_order_data”The filter returns the individual parameters sent to Messenger and lets developers modify them.
apply_filters('kbnt_messenger_order_data', $data, $order);Parameters
Section titled “Parameters”- $data (array) The individual parameters sent to Messenger. More information in the Messenger API documentation.
- $order (WC_Order) The order.
Source code
Section titled “Source code”The filter is located in the file classes/WooCommerce/Order.php.
kbnt_messenger_order_to_messenger_failure
Section titled “kbnt_messenger_order_to_messenger_failure”Action fired when an order fails to be sent to the Messenger system.
do_action('kbnt_messenger_order_to_messenger_failure', $order, $imported);Parameters
Section titled “Parameters”- $order (WC_Order) The order.
- $imported (stdClass) Messenger’s response regarding the sent order.
Source code
Section titled “Source code”The action is located in the file inc/order-to-messenger.php.
kbnt_messenger_order_to_messenger_success
Section titled “kbnt_messenger_order_to_messenger_success”Action fired when an order is successfully sent to the Messenger system.
do_action('kbnt_messenger_order_to_messenger_success', $order, $imported);Parameters
Section titled “Parameters”- $order (WC_Order) The order.
- $imported (stdClass) Messenger’s response regarding the sent order.
Source code
Section titled “Source code”The action is located in the file inc/order-to-messenger.php.
kbnt_messenger_package_weight
Section titled “kbnt_messenger_package_weight”Adjusts the weight of the packaging material.
apply_filters('kbnt_messenger_package_weight', $weight, $order);Parameters
Section titled “Parameters”- $weight (float) The weight of the packaging material.
- $order (WC_Order) The order.
Source code
Section titled “Source code”The filter is located in the file classes/WooCommerce/Order.php.
kbnt_messenger_pcs_per_package
Section titled “kbnt_messenger_pcs_per_package”Adjusts the number of products packed in each package.
apply_filters('kbnt_messenger_pcs_per_package', $pcs, $order);Parameters
Section titled “Parameters”- $pcs (int) The number of products in a single package.
- $order (WC_Order) The order.
Source code
Section titled “Source code”The filter is located in the file classes/WooCommerce/Order.php.
kbnt_messenger_send_error_notifications_active
Section titled “kbnt_messenger_send_error_notifications_active”Disables notifications about failed sends to Messenger.
apply_filters('kbnt_messenger_send_error_notifications_active', $send_notification);Parameters
Section titled “Parameters”- $send_notification (bool) Should the notification e-mail be sent?
Source code
Section titled “Source code”The filter is located in the file classes\Logger\Logger.php.
kbnt_messenger_send_error_notifications_to
Section titled “kbnt_messenger_send_error_notifications_to”Changes the recipient of the notification e-mail (default: the site admin).
apply_filters('kbnt_messenger_send_error_notifications_to', $to);Parameters
Section titled “Parameters”- $to (array) The recipients’ e-mail addresses.
Source code
Section titled “Source code”The filter is located in the file classes\Logger\Logger.php.
kbnt_messenger_send_other_shipping_methods
Section titled “kbnt_messenger_send_other_shipping_methods”Lets you pass an array of shipping method IDs (e.g. flat_rate) or strings {shipping method ID}:{shipping method instance ID} (e.g. flat_rate:1) for which orders will also be sent to Messenger.
If you don’t know the ID, you can find it on the Checkout by looking at the code, as I show in the video tutorial.
apply_filters('kbnt_messenger_send_other_shipping_methods', $other_methods);Example
Section titled “Example”add_filter('kbnt_messenger_send_other_shipping_methods', function() { return ['free_shipping', 'flat_rate:2'];});Parameters
Section titled “Parameters”- $other_methods (array)
shipping method IDs(e.g. flat_rate) or strings{shipping method ID}:{shipping method instance ID}(e.g. flat_rate:1) for which orders will also be sent to Messenger.
Source code
Section titled “Source code”The filter is located in the file inc/order-to-messenger.php.
Available since version 2.1.0.
kbnt_messenger_trackingstates
Section titled “kbnt_messenger_trackingstates”do_action('kbnt_messenger_trackingstates', $order, $data);Parameters
Section titled “Parameters”- $order (WC_Order) The order.
- $data (array) Shipment data from Messenger.
Source code
Section titled “Source code”The action is located in the file inc\endpoints.php.
kbnt_messenger_trackingstates_order_not_found
Section titled “kbnt_messenger_trackingstates_order_not_found”do_action('kbnt_messenger_trackingstates', $data);Parameters
Section titled “Parameters”- $data (array) Shipment data from Messenger.
Source code
Section titled “Source code”The action is located in the file inc\endpoints.php.
kbnt_messenger_variable_symbol_cod
Section titled “kbnt_messenger_variable_symbol_cod”Changes the variable symbol for cash-on-delivery payment.
apply_filters('kbnt_messenger_variable_symbol_cod', $order_id, $order);Parameters
Section titled “Parameters”- $order_id (int) The order number.
- $order (WC_Order) The order.
Source code
Section titled “Source code”The filter is located in the file inc\order-to-messenger.php.
Was this page helpful?
Thanks for the feedback!
Sorry to hear that. Tell me what was missing and how I can help →