Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Allow custom stock statuses
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Roberts <[email protected]>
  • Loading branch information
grogou and opr authored Aug 20, 2021
1 parent 63ecd04 commit 29c8493
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StoreApi/Utilities/ProductQueryFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function get_filtered_price( $request ) {
public function get_stock_status_counts( $request ) {
global $wpdb;
$product_query = new ProductQuery();
$stock_status_options = array( 'instock', 'outofstock', 'onbackorder' );
$stock_status_options = array_map( 'esc_sql', array_keys( wc_get_product_stock_status_options() ) );
$hide_outofstock_items = get_option( 'woocommerce_hide_out_of_stock_items' );
if ( 'yes' === $hide_outofstock_items ) {
unset( $stock_status_options['outofstock'] );
Expand Down

0 comments on commit 29c8493

Please sign in to comment.