Sales page
-
Hi.
I’m trying to create a page – Sale, using Elementor builder.
I place filter widget and products widget on page.
Use code:
add_action( ‘woocommerce_product_query’, ‘onsale_product_query’ );
function onsale_product_query( $q ){
if ( ! is_admin() && $q->is_main_query() && is_page(‘sales’)) {
// Only sales product
$product_ids_on_sale = wc_get_product_ids_on_sale();
$q->set( ‘post__in’, $product_ids_on_sale ); } }
Product show fine, but filter does not use initial selection value. How can I fix it?
Thanks
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Sales page’ is closed to new replies.