Overriding wc_get_product_ids_on_sale()
-
Hi,
I wish to override wc_get_product_ids_on_sale() function to check for products on sale also in custom post types.I simply wish to change that query
WHERE post.post_type IN ( 'product', 'product_variation' )
with
WHERE post.post_type IN ( 'product', 'product_variation', '<strong>specialproducts</strong>' )
I did a quick&dirty workaround rewriting the ‘wc_products_onsale’ transient with
add_action('init','my_get_product_ids_on_sale');
but I’m sure it should be a smarter way
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Overriding wc_get_product_ids_on_sale()’ is closed to new replies.