Menu Close

WooCommerce: Display Content Above Add to Cart @ Single Product Page

default

A client of mine decided to add a little notice (“30-day return policy offered”) just above the Add to Cart button on the WooCommerce single product page. There is no need to say this will allow her to increase the click-through rate and her sales conversion rate.

So, how to do this? Once again, it’s very simple. Just copy/paste the following snippet in your functions.php template file:

The PHP snippet to show text above Add to Cart:


/**
 * @snippet       Adds notice at single product page above add to cart
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=349
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 3.4.5
 */

add_action( 'woocommerce_single_product_summary', 'bbloomer_show_return_policy', 20 );

function bbloomer_show_return_policy() {
    echo '<p class="rtrn">30-day return policy offered. See Terms and Conditions for details.</p>';
}

The CSS customization

As you may have noticed, the HTML paragraph tag has an “id” so that you can style it via CSS. In my example I wrote this in the custom.css file:


.rtrn {
text-align: center;
font-style: italic;
}

Here’s the WooCommerce snippet final result:

WooCommerce: add notice @ single product page
WooCommerce: add notice @ single product page

View Source
Posted in WooCommerce Tips