'Exclude product from a function in woocommerce
I've used this function to round product prices in woo-commerce to tenth:
add_filter( 'raw_woocommerce_price', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_product_get_price', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_product_get_regular_price', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_product_variation_get_price', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_product_variation_get_regular_price', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_get_price_excluding_tax', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_get_price_including_tax', 'round_price_product', 1000, 1 ); add_filter( 'woocommerce_tax_round', 'round_price_product', 1000, 1 ); function round_price_product( $price ){ // Return rounded price return round( $price, -1 ); }
Is there any way to exclude a certain product from this function?
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
