Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom text below Add To Cart button in WooCommerce single product pages

So I have attached an image of my issue.

The code is right up on the button

Basically I followed the instructions on this Stack Overflow question thread right here:
Text under Add to cart (woocommerce)

I posted my question there 5 times and someone kept removing it, so I'm posting it again here. Please advise.

Update: I have already tried the paragraph tag, the break tag, and the pre tag.

like image 427
user8756001 Avatar asked Nov 21 '25 16:11

user8756001


1 Answers

You could try this (as you will see this is a CSS styling issue with the margin-top):

add_action( 'woocommerce_after_add_to_cart_button', 'custom_content_after_addtocart_button', 100 );
function custom_content_after_addtocart_button() {
    // custom content.
    echo '<br/><div><p style="font-size:10px; font-style=italic; margin-top:20px;">(*Contact us for bulk purchase enquiry)</p></div>';
}

Code goes in function.php file of your active child theme (active theme or in any plugin file).

Tested and works. You will get that:

enter image description here

like image 161
LoicTheAztec Avatar answered Nov 24 '25 05:11

LoicTheAztec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!