I wanted to do something different on my own checkout page, and change the default “Have a Coupon?” message. Thankfully, WooCommerce gives us a filter we can use to accomplish anything we like – such as adding a FontAwesome icon or changing the text string completely!
Continue reading WooCommerce: Edit “Have a Coupon?” Message @ CheckoutTag: Cart Page
WooCommerce: Change the “Remove this Item” Icon @ Cart
I have a very long to-write list. Possibly I have enough content for another 2 years ๐
However, the other day a premium WooCommerce student asked me for some feedback on his custom CSS – so I had to give it priority! The request was: what’s the easiest way to change the little icon/button on the Cart page that has the function of removing items from the cart (yes, that ugly white cross on a red circle)? Continue reading WooCommerce: Change the “Remove this Item” Icon @ Cart
WooCommerce Conditional Logic – Tags, Examples & PHP
The WooCommerce and WordPress conditional tags (“WooCommerce and WordPress Conditional Logic”) can be used in your functions.php to display content based on certain conditions. For example, you could display different content for different categories within a single PHP function.
Continue reading WooCommerce Conditional Logic – Tags, Examples & PHPWooCommerce: Display Regular & Sale Price @ Cart Table
In my opinion, the WooCommerce Cart table is somewhat confusing. Why isn’t the “sale price” displayed there? Well, this is a mystery!
I’m pretty confident that showing the “slashed” price would actually help your conversion rate.
So, what about 10 PHP lines in exchange for an increase in sales? Great! Here’s the snippet ๐
Continue reading WooCommerce: Display Regular & Sale Price @ Cart TableWooCommerce: Move & Change Number of Cross-Sells @ Cart Page
This week’s snippet is about the Cart Page (perfect timing, as in a few days I will run a free class on “How to Customize the WooCommerce Cart Page“).
Today we’ll focus on the “You may be interested In…” section, also called the “Cross-Sells” area. If a product that is in the cart has cross-sells (Edit Product > Product Data > Linked Products), this section will appear by default. Problem is – it is pretty ugly where it is now and distracts the user from identifying the “Proceed to Checkout” button, the most important CTA (Call To Action) of the Cart page.
So, how can me move it UNDER the Cart Totals, and make the design a little cleaner? Continue reading WooCommerce: Move & Change Number of Cross-Sells @ Cart Page
WooCommerce: Display Total Discount / Savings @ Cart & Checkout
If you love Ecommerce as much as I do, and are passionate about Sales Conversion Rate and reducing Shopping Cart Abandonment, today’s snippet will come in handy.
Besides, this is officially the first guest blog on Business Bloomer (have ideas? Send me your proposal here)… so let me officially introduce you to today’s author: Jamie Gill, a WordPress & WooCommerce enthusiast from Bradford, UK.
Jamie managed to code a handy snippet to display inside Cart and Checkout totals the total amount of money a customer saved (sale prices plus coupon discounts). Over the years this snippet went through several revisions, but it’s still working smoothly – enjoy!
Continue reading WooCommerce: Display Total Discount / Savings @ Cart & CheckoutWooCommerce: Hide Shipping Method If Shipping Class Is In The Cart
Our goal is to check if a Product with a specific Shipping Class is in the Cart, and consequently disabling a shipping rate such as Free Shipping if this is true.
This is super useful when there are multiple items in the cart and you don’t want to give free shipping for certain orders for example.
Continue reading WooCommerce: Hide Shipping Method If Shipping Class Is In The CartWooCommerce: Define a Minimum Order Amount
Today we take a look at the WooCommerce Minimum Order Amount. This snippet displays an error notification on the Cart Page and an error message on the Checkout Page if the order is below a set threshold.
Of course, it’s also up to you to let customers know there is a minimum before reaching the Cart/Checkout, so this could come as a notification in the single product page, shop page or even the header if it’s a strict business requirement.
Enjoy!
Continue reading WooCommerce: Define a Minimum Order AmountWooCommerce: Remove Cross-Sells @ Cart Page
A client wanted to completely remove the area on the Cart page where “You may be interested in…” cross-sell products show.
This is helpful if business needs change at some time and you don’t want to manually remove cross-sells from each single product in your store by hand. Enjoy!
Continue reading WooCommerce: Remove Cross-Sells @ Cart PageWooCommerce: Add Product to Cart On Visit Programmatically
Quite an interesting functionality! A WooCommerce client wanted their Cart pre-filled with one product as soon as their customers accessed the website. I don’t remember the exact reason, but this could be useful when you want to give them a free product by default, or you want to send your visitors straight to checkout with a product already in the cart without letting them add anything first.
Adding an item to cart programmatically is the same as “automatically”. Basically, all users will have a default, non-empty Cart filled with an item of your choice. So, let’s see how this snippet works!
Continue reading WooCommerce: Add Product to Cart On Visit ProgrammaticallyWooCommerce Visual Hook Guide: Cart Page
I’ve put together a visual (yet, you can copy/paste!) hook guide for the WooCommerce Cart Page. If you like this and it is helpful to you, let me know in the comments and I’ll create another one for the checkout, single product page and my account page.
You can find WooCommerce Cart hooks quickly and easily by seeing their actual locations. Great thing is – all you need to do in your functions.php is “add_action(‘place-hook-here’,’your-PHP-function-here’);” and you can place your custom functions anywhere on the WooCommerce Cart Page. Enjoy!
Continue reading WooCommerce Visual Hook Guide: Cart PageWooCommerce: Disable Shipping Rate if Variation ID @ Cart
A client needed to disable all shipping methods but Local Pickup for a certain variation ID. This may come useful if you’re looping through the variations on the cart/checkout page (check if variation ID is in the cart for example), so here you go! Continue reading WooCommerce: Disable Shipping Rate if Variation ID @ Cart
WooCommerce: Sort Shipping Costs from Low to High
A client had several shipping rates on the cart page automatically generated by FedEx, USPS, UPS and similar plugins via their API. Problem was, they wanted to sort them by price as opposed to grouping them by provider.
Thankfully, with a simple “uasort” PHP function, it’s possible to take the shipping rates array and sort it by amount before returning it back to the screen. If you don’t know PHP, simply copy/paste!
Continue reading WooCommerce: Sort Shipping Costs from Low to HighWooCommerce: Change “Return to Shop” URL
This simple snippet will make sure you can send users back to a custom page as opposed to the shop page when the Cart is empty. In this particular project, client had no shop page so we wanted to send users back to the homepage instead.
As usual, it’s a couple of lines of PHP, without the need to override templates or even worse to edit core WooCommerce. Enjoy!
Continue reading WooCommerce: Change “Return to Shop” URLWooCommerce: How to Hide Cart Table Columns
There are many reasons why you may want to remove columns (e.g. subtotal) from the Cart table. Sometimes you just want to make it easier for your customers. The less information you show the better!
Some other times,ย you may have custom requirements. Well, hiding a Cart table column is actually very easy – and despite this can be done with PHP I believe the CSS way is way faster in this case. Here’s how it’s done!
Continue reading WooCommerce: How to Hide Cart Table ColumnsWooCommerce: Only Allow 1 Product in the Cart
Here’s how to limit your WooCommerce Cart to just one product at a time.
This simple solution can be used for many applications. For example, your store may only allow to buy one subscription at a time.
On this same website, for example, customers can only purchase one product at a time so it’s easier for me to manage invoicing and payments, given that I switch PayPal and Stripe accounts based on what’s inside the cart.
Here’s the quick fix – enjoy!
Continue reading WooCommerce: Only Allow 1 Product in the CartWooCommerce: Hide Coupon Code @ Cart & Checkout Page
When you apply a coupon code programmatically, for example, you may want to hide the coupon code on the cart and checkout page so that the code stays private and cannot be shared with others.
This solution will basically remove the coupon code (e.g. “VWXYZ”) from the “Coupon: VWXYZ” string that appears in the Cart and Checkout totals. Enjoy!
Continue reading WooCommerce: Hide Coupon Code @ Cart & Checkout PageWooCommerce: Apply Coupon Programmatically if Product @ Cart
Users can manually enter a coupon code, refresh the Cart and see their discount apply… or you can do that automatically (or “programmatically” as we say in the dark web) when a user adds a product to the WooCommerce Cart ๐
All you’ve got to do is creating a coupon, and then a PHP function will do the whole work. Automation is the best thing in the world!
Continue reading WooCommerce: Apply Coupon Programmatically if Product @ CartWooCommerce: Remove / Edit “Added to Your Cart” Message
A client asked me to completely remove the message that appears after you add a product to the cart from the product page. This is simply done by using a PHP snippet, so here’s the quick fix for you!
Continue reading WooCommerce: Remove / Edit “Added to Your Cart” MessageWooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)
WooCommerce functions add the shipping method label on the Cart totals, on the left hand side of the price. This ruins the price amounts alignment (subtotal, shipping, taxes, total) and many clients have asked me to remove it completely. Also, it could be that sometimes you don’t want to show the name of a shipping rate on the front-end. So, here’s how you do it!
Continue reading WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)