In WooCommerce I use the following code to add some text around the displayed product price ("Rent:" and "/day") like:
function cp_change_product_price_display( $price ) {
echo 'Rent: ' . $price . '/day';
}
add_filter( 'woocommerce_get_price_html', 'cp_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cp_change_product_price_display' );
I also use the plugin "YITH WooCommerce Subscription" and there is a problem with my code. Now in the subscription packages I have one of this price displays:
- Rent: $20/7 days/day
- Rent: $80/month/day.
How to exclude subscription products or category of subscriptions from my codeTo avoid this problems?