• I’d like to add some text or images underneath the Add to Cart button on the product page.

    It’s a great spot for including things like “Free Returns” and “100% Moneyback Guarantee” etc to give customers an extra boost to click that button.

    How can I do that? I’m happy to buy a plugin if one exists. Or if someone could please tell me what code I should add where that would be great.

    It doesn’t need to be customizable per product, just one set of text and images for all product pages is fine.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can add some text with some custom css. The following works on my site, but if it doesn’t work on your site, your markup may be different. In this case, please post a link to one of your product pages.

    .woocommerce div.product form.cart:after,
    .woocommerce-page div.product form.cart:after,
    .woocommerce #content div.product form.cart:after,
    .woocommerce-page #content div.product form.cart:after
    {content:"Free Returns"; font-size:24px; font-weight:bold; color:red; line-height:40px}

    To do it per page, you would need to prefix the selectors with the relevant postid-000 class from the body tag.

    Images require more effort because the css content property can’t be used to add img tags. To do this I think you would need to make a custom page template. PHP skills will be required. If this is done right, it will be update-resistant, but eventually the template may need updating as WooCommerce develops, so it would be an on-going commitment.

    There may be a suitable hook that you can use in your child theme’s functions.php, but its still a coding job.
    https://docs.woothemes.com/document/hooks/

    I don’t know of a relevant plugin, which doesn’t mean there isn’t one ??

    This Tutorial may help you : product-images-to-woocommerce-checkout

    Thread Starter bruceleebee

    (@bennygill)

    Thanks for this guys.

    @lorro that was amazing explanation thanks! I really do need to input some images though. I need them to appear in this spot > https://prntscr.com/5nib1g.

    Here is an example product page I need it to appear on (not just this product though, all product pages on this site): https://petpresto.com.au/product/the-homemaker-large-chicken-coop-with-run/

    Can I not just edit the theme somehow? Which file would I do that in?

    @themelocation thanks for the help, but I am not looking to add images to the checkout (I have already done this). I am looking to add some text and images to the product page.

    Try this in functions.php for your child theme:

    <?php
      add_action ( 'woocommerce_single_product_summary', 'add_my_image', 40 );
      function add_my_image() {
        print '<img src=" ... " alt="" class="my_image" />';
      }

    Replace … with the link to your image. Does the image show up where you want it to?

    Thread Starter bruceleebee

    (@bennygill)

    Ok with a bit of hacking this I got it to work.

    thanks guys!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I add text or images under Add to Cart button?’ is closed to new replies.