Hi, I would like some help!
I am trying to only show discounted products on my page with Instyle and woocommerce. I have tried to make changes to the woocommerce "class-wc-query.php", as explained here:
https://www.kathyisawesome.com/woocomme ... uct-query/, but it does not do the trick. I suspect the Instyle theme is overriding my code, or isn't it triggered?
I know that the $product_ids_on_sale works since i got badges on the sale-items. This is what I have changed in the "class-wc-query.php":
- Code: Select all
/**
* Hook into pre_get_posts to do the main product query.
* @access public
* @param mixed $q query object
* @return void
*/
public function pre_get_posts( $q ) {
if ( ! $q->is_main_query() ) {
$product_ids_on_sale = wc_get_product_ids_on_sale();
$q->set( 'post__in', (array) $product_ids_on_sale );
}
My web-page:
http://www.fersketilbud.no/Any help?