I looking for a code snippet that will allow me to add a cart message warning the customer that certain products present in the cart require extra lead time for delivery. Any thoughts or suggestions?
Search Results for: Cart
WooCommerce: Add Hyperlink to Shipping Method Label @ Cart & Checkout
Let’s say you want to help customers understand your shipping rates and benefits right on the WooCommerce Cart and Checkout pages, by adding a link to each shipping option (e.g. “View shipping FAQ“).
As you can see from the first and second screenshot below, if you enter any HTML within the WooCommerce shipping zone -> shipping method settings, this will be stripped out, and HTML tags such as hyperlinks won’t work.
So, how can we add a clickable text link to each shipping method, given that we can’t use the WooCommerce settings? Well, as usual, a quick PHP snippet can help us with that. Enjoy!
Continue reading WooCommerce: Add Hyperlink to Shipping Method Label @ Cart & CheckoutWooCommerce: Apply Discount to Cheapest Cart Item
If you run WooCommerce store promotions, this little snippet will help you with that. For example, how to run a “Buy 2 products, get one half off” or a “Buy 3 products, get the cheapest one for free” campaign?
The trick behind this workaround is to find the cheapest item by looping through the cart, and then to set its price so that it’s lower than the regular price. Enjoy!
Continue reading WooCommerce: Apply Discount to Cheapest Cart ItemWooCommerce: Add to Cart Form @ Shop Page
We’ve already covered a similar customization on Business Bloomer: how to display Ajax quantity selectors on the WooCommerce Shop page. The problem there was that that only works for simple products, and only when Ajax add to cart is activated via the WooCommerce settings.
Today I’d like to experiment a little, and see what happens when we include the “add to cart template” (i.e. the one you see on the WooCommerce Single Product page) under each product on the WooCommerce Shop page.
This *should* work with all product types – especially variable products – because you will see the attribute dropdown selectors in such a case, as if you were on the single product page.
I haven’t tested this with grouped, bundle, and special product types, so feel free to share your findings in the comments below. Enjoy!
Continue reading WooCommerce: Add to Cart Form @ Shop PageWooCommerce: Pre-defined Add to Cart Quantity Selectors
I seriously spent more than usual trying to write a decent title. Still, I’m not 100% sure I’ve explained it well – so here’s some more context.
The WooCommerce Single Product Page add to cart form features a quantity input and an add to cart button. Super simple. Customers can define a quantity and add the current product to the cart.
Now, let’s imagine you want to change this experience based on your business requirements, and instead of the quantity input and add to cart button you want to show 3 buttons: “Add 1x to the cart“, “Add 2x to the cart“, “Add 3x to the cart“.
And if you can match this with a bulk quantity discount functionality, you can even change the messaging to e.g. “Add 1x to the cart“, “Add 2x to the cart and save $X“, “Add 3x to the cart and save $Y“…
So, let’s see how to hide the default add to cart form, and instead show buttons that allow the customer to add to cart a pre-defined product quantity (for simple products). As per this screenshot:
Continue reading WooCommerce: Pre-defined Add to Cart Quantity SelectorsWooCommerce Add to Cart Quantity Plus & Minus Buttons Mini-Plugin
You don’t feel confident with coding? You need a simple solution for displaying “plus” and “minus” buttons beside the add to cart quantity boxes? You don’t want to purchase yet another bloated, expensive plugin? Great!
Business Bloomer WooCommerce Add to Cart Quantity Plus & Minus Buttons is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. No settings.
Quick demo? Here it is:
As you can see the plugin works straight away. Install it, and see the magic happen!
WooCommerce Toggle Payments By Cart Total Mini-Plugin
You don’t feel confident with coding? You need more control over your payment/user role exclusions? You don’t want to purchase yet another bloated, expensive plugin? Great!
Business Bloomer WooCommerce Toggle Payments By Cart Total is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. A single and easy admin dashboard.
Screenshot of the settings:
Quick demo:
As you can see the settings are pretty straight forward. Select a payment method you wish to hide/show from the left, and the cart total amount that should trigger that from the right. Add more rules if needed. Simple!
WooCommerce Automatically Update Cart On Quantity Change Mini-Plugin
You don’t feel confident with coding? You don’t want to purchase yet another bloated, expensive plugin? Great!
Business Bloomer WooCommerce Automatically Update Cart On Quantity Change is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. No admin dashboard.
Quick demo:
As you can see the plugin is straight forward. Install it, and automatically see the result on the Cart page. Simple!
WooCommerce: Easily Get Cart, Checkout, Account, Product URLs
Just so you know, there is no need to hardcode WooCommerce URLs in your custom code! In fact, WooCommerce gives us helpful shortcut functions that we can reuse in our code to get cart, checkout, account and product URLs without wondering if they have been modified by the website owner e.g. example.com/cart to example.com/basket.
In this way, you can always make sure you’re getting the correct URLs without wasting time looking for page/product slugs. Enjoy!
Continue reading WooCommerce: Easily Get Cart, Checkout, Account, Product URLsWooCommerce Hide Price & Add to Cart If Logged Out Mini-Plugin
You don’t feel confident with coding? You don’t want to purchase yet another bloated, expensive plugin? Great!
Business Bloomer WooCommerce Hide Price & Add to Cart If Logged Out is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. A simple admin dashboard.
Screenshot of the settings:
Quick demo:
As you can see the settings are pretty straight forward. On top of hiding prices and add to cart buttons you can also choose if customers need to see a login message. Simple!
WooCommerce Only Allow 1 Product in the Cart Mini-Plugin
You don’t feel confident with coding? You don’t want to purchase yet another bloated, expensive plugin? Great!
Business Bloomer WooCommerce Only Allow 1 Product in the Cart is a mini WooCommerce plugin, without the usual hassles. One feature. Lifetime license. No annoying subscriptions. 1 plugin file. A few lines of code. No banners. No up-sells. No WP notifications. Use it on as many websites as you like. Lifetime support. 1-page documentation. Super simple admin dashboard.
Screenshot of the settings:
Quick demo:
As you can see the settings are pretty straight forward. Select the add to cart behavior from the dropdown, and the error message in case you choose the “Deny” behavior. Simple!
WooCommerce: Duplicate Add to Cart Button @ Single Product Page
In case you have very long single product pages, it may be helpful to show the Add to Cart form at the bottom of the page or even inside the description tab.
Thankfully this is pretty easy and only requires one line of code. The only thing that you may want to change is the hook name, which defines the position of the button, and the priority, which defines the relative position of the element in case there are other ones “hooked” onto the same hook.
In this example, we will place the button at the very bottom of the page, below tabs, upsells and related products. Enjoy!
Continue reading WooCommerce: Duplicate Add to Cart Button @ Single Product PageWooCommerce: Add to Cart Quantity Suffix
On a default WooCommerce install, we add X products to cart by defining the add to cart quantity on the single product page.
But what if your shop sells spices? It’s likely that those quantities are actually pounds / kilograms / or whatever weight unit you require. And what if your WooCommerce business is entirely focused around Italian extra virgin olive oil (asking for a friend!), that you’d sell per liter?
In such custom cases, it’s nice to specify the unit beside the add to cart quantity, so that customers know how much and what they are buying. So, let’s see how to add an add to cart quantity suffix beside the quantity input field on the single product page. Enjoy!
Continue reading WooCommerce: Add to Cart Quantity SuffixWooCommerce: Ajax Add to Cart Quantity @ Shop
As you know, you can tick the “Enable AJAX add to cart buttons on archives” checkbox in the WooCommerce settings in order to add products to cart from the Shop / Category / Tag / loop pages without refreshing the page.
This is great for certain businesses, especially those who sell in bulk and where customers know exactly what they need to buy without the need of checking the single product page.
The bad news is that the Ajax Add to Cart button only allows you to add 1 item to the cart i.e. there is no quantity input field. The other bad news is that the Ajax Add to Cart button only works for simple products, while for variable ones it will turn into a “Select options” link without the possibility of adding a variation to cart from there.
In this tutorial, we will see how to turn the WooCommerce shop into an… Ajax cart with quantity inputs. Enjoy!
Continue reading WooCommerce: Ajax Add to Cart Quantity @ ShopWooCommerce: Hide “View Cart” Button @ Mini-Cart
Your goal as a WooCommerce entrepreneur is… to get paid!
We’ve already seen how to put Cart and Checkout on the same page to save your customers a step and go straight to the purchase page – but no matter if you still have a Cart page or not, you may be interested in hiding the “View Cart” button from the cart widget dropdown, so that customers can go straight to the Checkout page and convert.
Here’s a super quick snippet to achieve just that. Enjoy!
Continue reading WooCommerce: Hide “View Cart” Button @ Mini-CartWooCommerce Subscriptions: Display Start-End Dates @ Cart & Checkout
Interestingly enough, when you add a subscription product to the cart, there is no renewal date information unless you scroll to the very bottom and are able to read the very small text below the “recurring total” (see screenshot).
It would be way more helpful if dates (and specifically the WooCommerce subscription start date and end date) showed right under the product name inside the Cart table and in the Checkout page order review, so that the customer knows exactly what they are purchasing before having to figure that out.
So, here’s how it’s done. Enjoy!
Continue reading WooCommerce Subscriptions: Display Start-End Dates @ Cart & CheckoutWooCommerce: Hide “Shipping to…” Address @ Cart
Even when the “shipping calculator” is disabled on the WooCommerce Cart page, a “Shipping to…” string will appear in the cart totals if an address has been previously entered or if geolocation is enabled.
Most WooCommerce store owners, however, wish to remove / hide this text, as it can be confusing for the customer. In this quick tutorial, we’ll study two different workarounds to achieve the same result. Enjoy!
Continue reading WooCommerce: Hide “Shipping to…” Address @ CartWooCommerce: Recover $$$ With a Cart Abandonment Plugin
Imagine having a customer who spends ages looking through your online store, adds several products to their cart – only to abandon the order at the last step. Frustrating, right?
Abandoned carts are a significant problem for eCommerce store owners. In fact, research suggests the average cart abandonment rate is nearly 70%. This means that 7 in 10 customers abandon shopping carts, leading to a loss in sales and revenue for businesses.
But what if there was a way around this?
Using WooCommerce abandoned cart recovery plugins, you can engage visitors even after they’ve abandoned their carts and left your store to convert them into customers.
In this article, we’ll explore the best plugins for abandoned cart recovery. But first, let’s understand how these plugins work and why you should use them.
Continue reading WooCommerce: Recover $$$ With a Cart Abandonment PluginWooCommerce: Why Enable Sliding Cart?
Cart abandonments are a WooCommerce store owner’s worst nemesis – research suggests a whopping 69.8% of customers abandon shopping carts, causing a massive dip in sales and revenue. The same study also revealed that high and unexpected shipping charges, complicated checkout processes, and inability to see the order total are some major reasons behind cart abandonment.
But what if there were ways you could overcome these problems and increase conversions?
Well, we already covered a possible solution here, so we’ll add to that today by looking at floating cart plugins.
These tools can help your customers view their shopping cart on any page of your WooCommerce store, saving them the back and forth between the page they’re currently on and the WooCommerce cart page.
Customers can see the items they’ve added to the cart, the order total, shipping costs, and even check out – all without going to another page. This can help smoothen their experience at your store and fasten the buying process, translating into more sales and profits for you.
This article will explore some popular WooCommerce floating cart plugins you can use to leverage this feature on your store. But first, let’s understand how floating carts work and help your online store generate more sales.
Continue reading WooCommerce: Why Enable Sliding Cart?WooCommerce: Hide Add to Cart If Already Purchased
We already saw how to hide add to cart for logged out users and how to find out if a user has already bought a given product – so I said why not combine the two snippets and figure out how to hide the add to cart button if a logged in customer has already purchased a product?
After that, however, I realized that the “woocommerce_is_purchasable” filter offered by the WooCommerce plugin makes the task much easier than just combining the two mini-plugins above.
So, here’s how it’s done – enjoy!
Continue reading WooCommerce: Hide Add to Cart If Already Purchased