AI Verified
WooCommerce Spend £X To Unlock Free Shipping
Native WooCommerce functionality means you can achieve this by setting am minimum order amount under the free shipping method options. However, this guide goes one step forward and bypasses these options. This guide allows you to display a message on the cart and checkout pages letting users know that free shipping is disabled unless they spend a certain amount. In this particular guide, we’ve disabled the shipping method, Free Shipping, unless the customer’s cart adds up to £50. On the cart and checkout pages, a message will appear above the totals breakdown stating the amount required for Free Shipping to be unlocked. Once the cart adds up to £50 or more, a message appears “You’ve unlocked Free Shipping”. Depending on your business requirements, you’ll need to tweak the free shipping threshold price. You’ll also need the shipping method radio button value which is explained further on.
PHP
Voted: 1 by 1 user(s)
Simply copy the pre-coded solution to your active child theme’s functions.php or preferably the Code Snippets Plugin.
The author has provided the following URL that may be helpful to setting up or using this snippet:
https://www.ecommercehints.com/woocommerce-spend-x-to-unlock-free-shippingScroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: 6.1
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
Free & Pro
Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.
Pro Only (Coming Soon)
You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.
Last modified:
14/11/2022
This snippet has the following status:
AI Verified
This snippet has been tested by our AI bot, see any comments below.
AI Bot Comments:
-------------------------------------------------------------------------------------------------------------
Name | Potential vulnerability found : Cross Site Scripting
Line | 21
Code | echo('You\'re ' . get_woocommerce_currency_symbol() . $cart_remaining . ' away from free shipping!<br><progress id="freeshippingprogress" max="50" value="'.$cart_total.'"></progress>')
Code | Line | 20 : $cart_remaining = 50 - $cart_total);
Name | Potential vulnerability found : Cross Site Scripting
Line | 33
Code | echo('Spend another ' . get_woocommerce_currency_symbol() . $cart_remaining . ' for free shipping!<br><progress id="freeshippingprogress" max="50" value="'.$cart_total.'"></progress>')
Code | Line | 20 : $cart_remaining = 50 - $cart_total);
Found 2 vulnerabilities
1
Please see some snippets below related to this snippet..
WooCommerce
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
Hide Other Shipping Methods When Free Shipping Available
WooCommerce
AI Verified
Added: 3 months ago
Last Updated: 3 months ago
Remove btn na página de produto (alguns produtos)
WooCommerce
Pro Verified
Added: 1 year ago
Last Updated: 2 weeks ago
Wouldn't you like to know how many of an item you'd sold?
These are some popular snippets from this users codevault..
WooCommerce
AI Verified
Added: 1 year ago
Last Updated: 11 months ago
We want to make this solution absolutely clear from the outset. This snippet does NOT generate the actual number of people viewing the product. It shows a randomly generated number in the range of two...
WooCommerce
AI Verified
Added: 1 year ago
Last Updated: 6 months ago
Showing the number of product units sold on the single product page is a great way to introduce Fear Of Missing Out (FOMO). You can highlight how many products are sold to let customers know a product...
WooCommerce
AI Verified
Added: 1 year ago
Last Updated: 11 months ago
How many times have you bought something online and seen trust symbols near the proceed to checkout button on the cart page? “30 Day Money Back Guarantee” or “Secure Checkout” are popular examples. By...
Category
Snippet Status