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 Page
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 1 to the cart“, “Add 2 to the cart“, “Add 3 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 1 to the cart“, “Add 2 to the cart and save $X“, “Add 3 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: Add to Cart Pre-defined Quantity Selectors
By default, WooCommerce displays a “Buy Product” button label for external products. This button redirects to the external URL that is entered via the single product settings.
As usual, this “Buy Product” label may not suit all businesses, and therefore WooCommerce gives you the option to rename such buttons via the single product edit page settings. This is great, but at the same time you don’t want to manually edit hundreds of products when you can use a few lines of PHP, right?
So, here’s a super quick fix to override the “Buy Product” external add to cart button label to whatever you wish, without ever touching the manual settings. Enjoy!
Continue reading WooCommerce: Change “Buy Product” Label for External Products
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 Page
Yeah Google Analytics is cool, but have you ever coded your own tracking functions within your WooCommerce website?
An example may be counting the number of times customers click on the “Buy product” button that displays on the Single External Product Page, and show the counter in the Products Table in the backend.
For example, I use this to calculate the Click Through Rate (% clicks / views) and see how popular an external product is. Of course, you could also decide to extend the counter to all products (simple, variable, etc.) and count the number of times customers click on the Add to Cart, but for today let’s stick to the external products count. Enjoy!
Continue reading WooCommerce: Count External Product Clicks
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 Suffix
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 @ Shop
On top of adding products to cart via URL and redirect to checkout, there is a way to also fill out the Checkout page input fields within the same link.
This could be super handy when you know the billing/shipping details of a registered or guest customer and want to speed up the order process.
It’s important to note that the URL will need to contain personal data e.g. email address, billing address, phone number, and so on; you need to make sure the URL is only shared with the specific customer (in an email, for example, as content is tailored to the subscriber; or only when the WooCommerce customer is logged in if you’re using the URL behind a website button).
Once that’s clear, let’s go ahead, and let’s see how my WooCommerce snippet works. Enjoy!
Continue reading WooCommerce: Populate Checkout Fields From URL
The WooCommerce “Order Again” button displays for ‘completed’ orders on the Thank You page and View Order page. That’s a pity, because it would be useful to show it on the My Account > Orders page as well, as a custom “action”, same as the “View”, “Pay” (if pending), “Cancel” (if subscription), “Edit” (custom snippet), “Confirm” (custom snippet) buttons.
The good news is that we can code it ourselves! And just reuse most of the code we already wrote, as well as rely on the WooCommerce “listener” for the existing “Order Again” button. Enjoy!
Continue reading WooCommerce: Order Again Button @ My Account > Orders
In the era of online courses, subscriptions, custom-made products and product personalization, it may happen a scenario where a user can only purchase a product once in their lifetime.
In this short tutorial, we will see how this is done.Clearly, the user must be logged in in order for the code to trigger, so this applies to stores that require checkout login in order to proceed with the order.
Continue reading WooCommerce: Only Allow to Buy a Product Once
Imagine if your customers didn’t have to visit a separate product page every time they wanted to check out a product. They could see product details right from the page they’re on and avoid going back and forth between the store and product pages.
Sounds convenient, right?
This is exactly what a quick view feature on your WooCommerce store can do.
It allows shoppers to view product images, features, and prices from the shop page through a popup window. This way, they can see if they like the product and add it to their cart or simply close the popup and continue browsing items.
That’s not it. By making product surfing and shopping fast and hassle-free, the quick view feature can also help you improve customer experience and increase your store sales and revenue.
Although a pretty useful feature, WooCommerce doesn’t have any default settings to enable a quick view button in your store.
The good news is that there are some great quick view plugins you can use to add this functionality to your shop and optimize it for sales.
We’ve done the legwork and compiled a list of seven of the best WooCommerce quick view plugins you can use for your online store. Let’s dive in!
Continue reading WooCommerce: Top Quick View Plugins
If you’ve experienced the difficulty and high cost of acquiring new customers, you’re not alone. The estimated probability of selling to a new prospect is only five to 20 percent. Compare that to the probability of selling to an existing customer: 60 to 70 percent.
That’s not all. Depending on your business and your industry, it can be five to 25 times more expensive to acquire a new customer than it is to retain one you already have. That’s despite all your pre-sales preparation.
As you can see, retaining your existing customers – or those who show an intent to buy – is paramount. How to increase revenue from them, however, continues to elude many businesses.
Fortunately, it doesn’t need to be hard. With the help of WooCommerce, you can easily create personalized recommendations to attract more sales from customers who are already interested in your offerings.
Using customized recommendations works to your advantage as internet users have grown fond of personalization. In fact, ninety percent of customers find personalization of their shopping journey appealing, and 71 percent feel at least some frustration when the experience is totally impersonal.
In this post, we’ll take a closer look at cross-selling and its benefits. We’ll also show you how you can create an effective strategy for your online store, using the WooCommerce Added to Cart trigger in MailOptin. Let’s get started!
Continue reading WooCommerce: Winning With a Cross-Sell Strategy
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?
Business Bloomer enters the world of Gutenberg today, and we do it with a simple customization tutorial related to the “Product Grid” WooCommerce Gutenberg Blocks: currently these are “Best Selling Products“, “Newest Products“, “On Sale Products“, “Top Rated Products“, “Products by Category” and use the same base code…
However, all of them use custom code and not the default WooCommerce templates (and therefore we can’t take advantage of the WooCommerce hooks for the shop / product archive / product loop unfortunately), so we need to find a workaround if we wish to remove some of the default elements that come up with the product grid items: product permalink, product image, product title*, sale badge, product price*, rating*, add to cart button* in this exact order.
* As you can see from the screenshot below, actually, you can already remove the information with an asterisk from the Block settings. So, in this article, we will see how to remove the rest in case you don’t want it: permalink, image, sale badge. Enjoy!
Continue reading WooCommerce Blocks: Hide Images Etc. From Product Grid Block
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
There are times when the WooCommerce product settings alone are not enough. You can already tick the “Sold individually” checkbox in the “Inventory” product data tab in the single product edit page to force quantity 1 for whatever product: “Enable this to only allow one of this item to be bought in a single order“.
Problem is, you may need to set this “programmatically” (via code), based on certain conditions. One reason is that you may not want to edit hundreds of products one by one (or in bulk) – another is that you may want to “override” whatever settings based on certain conditions (for example, you set “Sold Individually”, but if the Cart total is greater than 100 you want to allow quantities greater than 1).
As you can see, in this post we will cover, once again, the magic of “conditional logic“. Enjoy!
Continue reading WooCommerce: Conditionally Force Product Quantity 1 @ Cart
If you’re here it’s because your WooCommerce website is slow and you’re wondering why the “/?wc-ajax=get_refreshed_fragments” URL generates delays and server loads (spikes).
Besides, there is too much online literature about WooCommerce Ajax Cart Fragments (including specific plugins and performance plugin options), and you want to learn quickly what they are before understanding if and how you should disable them.
Performance optimization tools like Pingdom and GTMetrix often put the blame on this little WooCommerce functionality. And disabling it carefully can give you a boost in speed, page load and ultimately sales conversion rate.
So here’s all you need to know.
Continue reading WooCommerce: Why & How to Disable Ajax Cart Fragments
We already saw how to add a product to cart automatically, for example if you visit a specific page or if there are no products in the cart – but today we want to find out how to do the opposite: if a certain condition is met, we want to remove a product ID from the cart.
This becomes a little complex – while adding an item to cart requires just its product ID, removing it from the cart forces you to know the “cart item key”. Japanese, I know, but just copy the snippet and you’re done!
Continue reading WooCommerce: Remove Product From Cart Programmatically
Here’s a quick snippet you can simply copy/paste or a mini-plugin you can install to show a “+” and a “-” on each side of the quantity number input on the WooCommerce single product page and Cart page.
The custom code comes with a jQuery script as well, as we need to detect whether the plus or minus are clicked and consequently update the quantity input. jQuery might look difficult to many, but the beauty of this is that you don’t need to have a degree in jQuery – just copy/paste the code or install the lightweight plugin and see the magic happen.
Continue reading WooCommerce: Add to Cart Quantity Plus & Minus Buttons
Less is more (sometimes). On this same website, I’m already forcing max 1 product in the Cart and automatically redirecting users to Checkout upon add to Cart. On top of that, I’ve disabled WooCommerce cart fragments for performance reasons.
As a result, I definitely don’t need the whole “Mini-Cart Widget Dropdown Content”. To test, try to “hover” onto the shopping cart icon on the top right, and you’ll notice there is no cart dropdown.
Well, this is how it’s done – I love when a complex thing is fixed with one simple line of PHP!
Continue reading WooCommerce: Remove Mini-Cart Widget Dropdown