• Home
  • About
  • Portfolio
  • Services
    • Overview
    • SEO
    • Copywriting
    • Law
  • Testimonials
  • Blog
  • Contact
    • Facebook
    • LinkedIn
    • Pinterest
    • Twitter

Angel Digital Marketing

Website Design - Digital Marketing - SEO

You are here: Home / Blog / Woocommerce check basket total, calculate required spend

Woocommerce check basket total, calculate required spend

2nd December 2021 by Jen Wiss-Carline Leave a Comment

Woocommerce

This little snippet checks the Woocommerce basket total and calculates how much more the customer needs to spend to get a free offer. In this case, the free offer is free shipping.

You can add this message using a hook to the top of the basket page. I’m using Generatepress on the site I wrote this for, so the hook for this is generate_before_content. Generatepress really does make this very easy. Otherwise you can read up on hooks here.

The message changes once they reach the required total, to show that they’re entitled to the offer.

NB if your offer is free shipping, you should set it up to apply the free shipping automatically once the total is reached.

I know you can do this with plugins but I wrote this for a site that has too many plugins already (and then used it on my own jewellery site, as you can see!). Only a little code is needed, so why bother with adding yet another plugin. Hope this is useful – comments and suggestions welcome!!!

Snippet

Click to download as TXT file

You can add some styling of course:


.freebies {background-color:#e8f2ff}
.freebies span {font-size:0.8em}

About Jen Wiss-Carline

Jen has provided web development, SEO and copywriting services to businesses large and small since 2001.

The summer house office

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Woocommerce check basket total, calculate required spend 2nd December 2021
  • The summer house office 27th July 2017
  • 99 king content ideas for your website 5th October 2014
  • SEO services – are they worth the money? 21st May 2014
  • What’s going on with guest posting? 28th February 2014

Connect:

  • Facebook
  • LinkedIn
  • Pinterest
  • Twitter

Archives

  • December 2021
  • July 2017
  • October 2014
  • May 2014
  • February 2014
  • December 2013
  • November 2013
  • October 2013
  • June 2013
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • February 2012
  • November 2011
  • September 2011
  • July 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • Home
  • About
  • Services
  • Copywriting
  • Portfolio
  • Blog
  • Image sitemap tool
  • Contact

© 2023 · Jennifer Wiss-Carline, 78 Homefield Avenue, Arnold, Nottingham NG5 8GA. Tel: 07984 182935 Email: jenniferlwiss AT gmail.com