Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Remove finished auctions from related products.
- this code should be placed in child theme functions.php file
- */
- add_filter( 'woocommerce_product_related_posts_query', 'custom_remove_finished_auctions_from_related_products' );
- function custom_remove_finished_auctions_from_related_products( $query ) {
- $finished_auctions = wsa_get_finished_auctions_id();
- if ( count( $finished_auctions ) ) {
- $query['where'] .= ' AND p.ID NOT IN ( ' . implode( ',', array_map( 'absint', $finished_auctions ) ) . ' )';
- }
- return $query;
- }
Advertisement
Add Comment
Please, Sign In to add comment