D
D
Den Totsky2019-12-25 17:25:09
WooCommerce
Den Totsky, 2019-12-25 17:25:09

How to fix the filter in the admin panel after adding a custom balance status?

WooCommerce version: 3.8.1
Added a custom field to stock_status through a filter:

add_filter(
  'woocommerce_product_stock_status_options',
  'ec_add_custom_product_stock_status_option'
);
function ec_add_custom_product_stock_status_option ($arr) {
  $arr['fororder'] = __( 'Доступно для заказа', 'woocommerce' );
  return $arr;
}

Everything works, except for the actual filter of these statuses in the admin panel on the "All products" page.
It shows "No items found" even for the instock option.
For new products, and if I manually, according to a new one, set the status of the balance in the product, this product, miraculously, will fall into the filter. I just don’t understand, maybe you can somehow update the statuses for all products?
What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question