by_stock – a second sorting parameter
-
Hello,
I want to make a second sorting option by_stock.
I do like this, it does not work(function sv_change_sorting_fallback( $fallback, $orderby ) { if ( 'featured_first' === $orderby ) { $fallback = 'by_stock'; } return $fallback; } add_filter( 'wc_extra_sorting_options_fallback', 'sv_change_sorting_fallback', 10, 2 ); function sv_change_sorting_fallback_order( $fallback_order, $orderby ) { if ( 'featured_first' === $orderby ) { $fallback_order = 'DESC'; } return $fallback_order; } add_filter( 'wc_extra_sorting_options_fallback_order', 'sv_change_sorting_fallback_order', 10, 2 );Help me please!)
https://ww.wp.xz.cn/plugins/woocommerce-extra-product-sorting-options/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘by_stock – a second sorting parameter’ is closed to new replies.