I was needed to add a custom text beside the price in single product page and in the shop page just before the price. I searches in the web and did not got any solid solution. Finally I figure this and working fine for me.

Adding custom text before the price in shop page/home page:

For rewrite the woocommerce plugin template first you need to create a folder/directory and named as woocommerce in your theme directory i.e. the path should be /wp-content/themes/your current theme. For example /wp-content/themes/room09

Now go to your plugin directory and find content-product.php copy /download the template. Now find the code <?php the_title(); ?></h3> now just put <span>Your Custom Text</span>and save the template. Now upload it to your current theme directory path i.e in the woocommerce folder you just created a bit before (/wp-content/themes/room09/woocommerce).

Adding custom text beside the price in single product page:

Now go to your wordpress plugin directory and download the price template price.php then find the code like that <p itemprop=”price” class=”price”><?php echo $product->get_price_html(); ?> p> now replace this code with the below code.

<p itemprop=”price” class=”price”><?php echo $product->get_price_html(); ?>&nbsp;&nbsp;<span style=”color:#1f497d; text-transform:none”;>Price is Inclusive of GST</span></p>

You can use the custom color.

Now create a folder at /wp-content/themes/your current theme/woocommerce and named it “single-product” i.e it should be /wp-content/themes/your current theme/woocommerce/single-product and upload your editted price.php in this directory.

This should be final look bellow.

Add text beside the price woocommerce Add text beside the price woocommerce

 

Related Posts

Top 6 latest free plugins for WordPress to follow in 2020

Top 6 latest free plugins for WordPress to follow in 2020

WordPress is arguably one of the best content management systems in the world. Its effectiveness, efficiency and simplicity gives it an edge over competition. Another thing that makes WordPress stand out is the fact that it is compatible with a number of plugins and...

read more
How to create clickable phone and sms link?

How to create clickable phone and sms link?

How to create clickable phone and sms link? Nowadays no one can pass a single day without a smartphone. Laptop/Computer Tabs are much more essential for web browsing in modern day. So a web designer or web developer should care about creating clickable phone links and...

read more