{"id":512,"date":"2021-10-20T09:43:44","date_gmt":"2021-10-20T09:43:44","guid":{"rendered":"https:\/\/help.kybernaut.cz\/help\/filtry-pro-vyvojare\/"},"modified":"2024-05-16T11:49:54","modified_gmt":"2024-05-16T11:49:54","slug":"filters-for-developers","status":"publish","type":"ht_kb","link":"https:\/\/help.kybernaut.cz\/en\/help\/filters-for-developers\/","title":{"rendered":"Filters for developers"},"content":{"rendered":"\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">If you don&#8217;t find the filter or action you need here, <a href=\"https:\/\/help.kybernaut.cz\/potrebuji-pomoci\/\" data-type=\"page\" data-id=\"20\">please contact<\/a> me with where and how you would like it added and I will be happy to do so to make further plugin updates safe.<\/p>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_blocked_statuses_update<\/h2>\n\n<p>The filter returns order statuses where the order status is no longer updated based on Mailstep data.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_blocked_statuses_update', &#91;'completed',\n 'failed', 'cancelled', 'refunded']);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$statuses<\/strong> (array) Order states<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> kybernaut-mailstep.php<\/em>.<\/p>\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">kbnt_mailstep_cod_payment_methods<\/h2>\n\n\n\n<p>The filter returns slugs of payment methods that are considered cash on delivery.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_cod_payment_methods', &#91;'cod', 'dobirka']);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$methods<\/strong> (array) Slugy payment methods considered cash on delivery.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n\n\n<p>The filter is located in the files<em> includes\\class-kbnt-mailstep-api.php<\/em>, <em>includes\\class-kbnt-mailstep-orders.php<\/em>.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">kbnt_mailstep_fallback_couriers<\/h2>\n\n\n\n<p>Allows you to introduce a fallback for unset couriers. Accepts the WooCommerce shipping method ID fas a key and the Mailstep courier ID as a value.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_fallback_couriers', &#91;]);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$fallback_couriers<\/strong> (array) WC method_id \u2192 Mailstep courier_id.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Example of use<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('kbnt_mailstep_fallback_couriers', function(){\n\treturn &#91;\n\t\t\"local_pickup\" => 123,\n\t];\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-api.php<\/em>.<\/p>\n<\/div><\/div>\n<\/div><\/div>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_get_order_courier_id<\/h2>\n\n<p>Allows you to edit the Courier ID.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_get_order_courier_id', get_option('wc_kbnt_mailstep_settings_shipping_' . $shipping_method-&gt;get_method_id() . ':' . $shipping_method-&gt;get_instance_id(), false), $order, $shipping_method-&gt;get_method_id(), $shipping_method-&gt;get_instance_id());<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$courier_id<\/strong> (int) Courier ID (according to Cybernaut Mailstep settings).<\/li>\n\n\n\n<li><strong>$order<\/strong> (WC_Order) Order.<\/li>\n\n\n\n<li><strong>$method_id <\/strong>(string) Delivery method ID.<\/li>\n\n\n\n<li><strong>$instance_id<\/strong> (string) The instance ID of the delivery method.<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-api.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_order_set<\/h2>\n\n<p>The filter returns the individual parameters sent to Mailstep and allows developers to edit them.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_order_set', $parameters, $order);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$parameters<\/strong> (array) Individual parameters sent to Mailstep.<\/li>\n\n\n\n<li><strong>$order<\/strong> (WC_Order) Order.<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-api.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_sync_excluded_store_ids<\/h2>\n\n<p>The filter allows you to exclude warehouses from Mailstep&#8217;s warehouse status synchronization. Store IDs can be found either from Mailstep or in the log. <strong><a href=\"https:\/\/help.kybernaut.cz\/help\/synchronizace-skladu\/#vymazani-mezipameti-pro-synchronizaci-skladu\" data-type=\"URL\" data-id=\"https:\/\/help.kybernaut.cz\/help\/synchronizace-skladu\/#vymazani-mezipameti-pro-synchronizaci-skladu\">Empty the sync cache<\/a> after changing the edit.<\/strong><\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_sync_excluded_store_ids', &#91;]);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$exluded_store_ids <\/strong>(array) List of stack IDs (string).<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-inventory-sync.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_sync_inventory_products_per_sync<\/h2>\n\n<p>The filter returns the individual how many products are synchronized with the stock status in Mailstep at once.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_sync_inventory_products_per_sync', 300);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$products_per_sync<\/strong> (int) Number of products synchronized at once.<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-inventory-sync.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_sync_inventory_recurrence<\/h2>\n\n<p>The filter allows you to set how often the automatic synchronization of the warehouse will be triggered. After the change, turn the warehouse synchronization off and on to allow rescheduling to occur.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_sync_inventory_recurrence', 'hourly');<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$recurrence <\/strong>(string) How often the event should subsequently be repeated. For acceptable values, see <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_get_schedules\/\" target=\"_blank\" rel=\"noreferrer noopener\">wp_get_schedules()<\/a>.<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-inventory-sync.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_sync_only_store_id<\/h2>\n\n<p>The filter allows you to select one warehouse to be selected for synchronizing the warehouse status from Mailstep. You can find out the Store ID either from Mailstep or in the log. <strong><a href=\"https:\/\/help.kybernaut.cz\/help\/synchronizace-skladu\/#vymazani-mezipameti-pro-synchronizaci-skladu\" data-type=\"URL\" data-id=\"https:\/\/help.kybernaut.cz\/help\/synchronizace-skladu\/#vymazani-mezipameti-pro-synchronizaci-skladu\">Empty the synchronization cache<\/a> after changing the edit.<\/strong><\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_sync_only_store_id', \"\")<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$store_id <\/strong>(string) Warehouse ID.<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-inventory-sync.php<\/em>.<\/p>\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n<h2 class=\"wp-block-heading\">kbnt_mailstep_unreleased_stock_order_statuses<\/h2>\n\n<p>This setting will allow working with a &#8220;blocked&#8221; warehouse, i.e. adds the goods not stocked by Mailstep to the stock on the e-shop and thus prevents artificially increasing the stock. By default it contains &#8220;Pending&#8221;, &#8220;On hold&#8221; and &#8220;Mailstep &#8211; incorrectly entered&#8221;, but you can modify them as follows. After the modification <strong>, you need to <a href=\"https:\/\/help.kybernaut.cz\/help\/synchronizace-skladu\/#vymazani-mezipameti-pro-synchronizaci-skladu\">empty the storage cache<\/a><\/strong>.<\/p>\n\n<pre class=\"wp-block-code\"><code>apply_filters('kbnt_mailstep_unreleased_stock_order_statuses', &#91;'wc-pending', 'wc-inputerror', 'wc-on-hold']);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>$statuses <\/strong>(array) Order states<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Source code<\/h3>\n\n<p>The filter is located in the file<em> includes\\class-kbnt-mailstep-inventory-sync.php<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Does your developer need to interfere with my plugin? Here you will find a few standardized points on how to do it.<\/p>\n","protected":false},"author":1,"template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[52],"ht-kb-tag":[58,76,60,66],"class_list":["post-512","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mailstep-en","ht_kb_tag-customization","ht_kb_tag-edits","ht_kb_tag-filters","ht_kb_tag-for-developers"],"_links":{"self":[{"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":11,"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb\/512\/revisions"}],"predecessor-version":[{"id":642,"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb\/512\/revisions\/642"}],"wp:attachment":[{"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb-category?post=512"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/help.kybernaut.cz\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}