How to add a different text to the price depending on the type of user Rool?
-
Thanks for this great plugin, I’m just testing it and it works fine.
I have a question and I come looking for help.
In the price that is shown to all users in the store, I have added a text after the price: P.V.P.
I have achieved this with a function that a friend made, I show you this function below.My intention is to achieve that in the price that is displayed to the users created with the Wholesale Customer Rool, in the products, behind the price that I have created with Wholesale Customer, instead of showing the text that I have now ( P.VP. ) ), show the following text (P.V.M. ) WHOLESALE PRICE.
This is a problem for me, since I haven’t mastered php yet how to create a function to achieve this.
Can you give me an idea to achieve this ?
Have other users already asked about this?
Thank you
function:
function custom_price_message( $price ) {
global $post;
$product_id = $post->ID;
$textafter = ‘ P.V.P.’; //texto que vamos agregar
return $price . ” . $textafter . ”; //class textafter para el CSS
}
add_filter( ‘woocommerce_get_price_html’, ‘custom_price_message’ );
- The topic ‘How to add a different text to the price depending on the type of user Rool?’ is closed to new replies.