samedi 18 avril 2015

Woocommerce add filter conditions

I use the filter woocommerce_get_price which rounds up products price.



add_filter( 'woocommerce_get_price', 'round_price_product', 10, 1);

function round_price_product() {
//code and returns rounded price

}


I want to remove this filter from certain products.


For example product 1, product 2, product 3 all use the filter woocommerce_get_price and their prices are all rounded.


For product 4 & 5 i don't want the filter to be used.


How do i omit filters from certain products?


Aucun commentaire:

Enregistrer un commentaire