Single Product – Add Content After Add to Cart

Woocommerce Single Product Page Snippet

Want to add text under the add to cart button on the single product page? Then use the below snippet. If you need help implementing this we can help please use of submit a woocommerce job form.

In the example we added a DIV layer with the text “OR do it yourself” text.

The snippet below forces WordPress to allow SVG files for upload. To use the snippet:

Implementation

1. Either code and paste the code into your themes functions.php or child theme
2. If you are not that technical then install the WordPress Snippets plugin

/**
 * @snippet     Woocommerce - Single Product - Add Content After Add to Cart
 * @code        https://techskilled.co.uk/snippets/woocommerce-add-content-after-add-to-cart-single-product-page
 * @author      https://techskilled.co.uk
 */

function show_content_after_add_to_cart() {

      echo '<div style="clear:both;padding-top:20px;"><a href="#doit" style="font-weight:600">OR Doing it yourself?</a></div>';
}
add_action( 'woocommerce_after_add_to_cart_button', 'show_content_after_add_to_cart' );

Woocommerce Snippet Add text Under Cart

View on snippet on GitHub.

NEED HELP?

If you are struggling to implement the SVG snippet then we can help from £9.99 – use our contact form below and we will get straight back to you!

HELP ME IMPLEMENT THIS SNIPPET

Leave a comment

Shares