WooCommerce Custom Sorting options
-
Hi,
I’m using a WooCommerce Custom Sorting Option (https://docs.woocommerce.com/document/custom-sorting-options-ascdesc/) which makes Relevanssi fail the SQL query call.
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); function custom_woocommerce_get_catalog_ordering_args( $args ) { $orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); if ( 'new_product_list' == $orderby_value ) { $args['orderby'] = 'meta_value'; $args['order'] = 'desc'; $args['meta_key'] = 'brainie_produs_nou'; } return $args; }
Any way to resolve this issue?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WooCommerce Custom Sorting options’ is closed to new replies.