Reputation: 748
I'm looking for simple solution how to convert URL query like this:
?orderby=date-desc&query_type_color=or&filter_color=white,black&query_type_material=or&filter_material=iron&min_price=120&max_price=1190
into product loop query for WooCommerce. I prefer to use WP_Query or wc_get_products.
Please notice that query must contains all possible woocommerce product filter options like, order, orderby, taxonomy, attributes, min/max price, ...
I don't want to use any plugin.
Thanks
Upvotes: -4
Views: 548
Reputation: 699
You can do it in the following way.
add_query_arg( array(
'orderby' => 'date-desc',
'query_type_color' => 'or',
'filter_color' => 'white'
........
.........
), 'http://example.com');
Upvotes: 0