WooCommerce: Decrease Product ‘Total Sales’ Upon Refund

Every time an order is placed on your WooCommerce website, the purchased products’ total_sales counter increases thanks to a core function. It’s then easy to retrieve the value and maybe show the number of sales on the single product page, which is great for social proof and sales conversion rate optimization.

The big problem – and don’t ask me why this is not into core – is that if you need to refund an order (or cancel it), the total_sales counter will not reset / decrease, which is odd.

Today we’ll fix this, so that your products are always up to date with their sales counter and you can be more confident in showing the correct values. Enjoy!

Continue reading WooCommerce: Decrease Product ‘Total Sales’ Upon Refund

WooCommerce: Display Long Description Instead Of Short One @ Single Product Page

Especially when you migrate from a different ecommerce platform to WooCommerce, you may end up placing or importing content in the wrong place.

A lot of confusion, for example, arises when a new WooCommerce store owner needs to understand the difference between the “Long” and the “Short” description. Well, the “Long description” is the one that displays inside the “Description” tab, below the product summary (that section that features the image on the left + add to cart on the right), usually in full width. The “Short description“, on the other hand, is the one that shows on the right hand side of the product image, and is usually… shorter.

Now, what if you don’t use the “Short description” in your WooCommerce store, and you wish to display the “Long description” on the right hand side of the featured image instead? Well, here’s a simple snippet for you. Enjoy!

Continue reading WooCommerce: Display Long Description Instead Of Short One @ Single Product Page

WooCommerce: Limit Daily Sales For Cheap Products (Anti-Spam)

We could call this the “WooCommerce Anti-Spam Without a Plugin” series, while I attempt to fight against bad humans and very bad bots who love attacking the Business Bloomer checkout page with spam orders and fake user registrations.

My first attempts were (1) My Account registration anti-spam honeypot, (2) Checkout anti-carding-attack honeypot, and (3) Reducing the number of admin emails, but I can tell that (2) didn’t work, and I got another carding attack on a $9 product last weekend. Bots are smart.

Today, I’d like to share another anti-spam snippet that I’m currently testing on Business Bloomer. Most carding attacks, in fact, end up with the purchase of a single product in the $1-$9 range – which means that limiting the daily sales for specific, inexpensive, products may do the trick.

My code counts the times each product has been purchased during the day – and if a carding attack occurs, the product won’t be purchasable any longer until the end of the day. Because we’re talking about cheap products, it’s no problem for me to disallow legit sales as well for 24 hours. Use at your own risk, of course.

We already covered how to “Limit Sales Of A Product Per Day“, but this time I’d like to apply that to an array of products – and specifically all those that are under $10. Enjoy!

Continue reading WooCommerce: Limit Daily Sales For Cheap Products (Anti-Spam)

WooCommerce: Display “Related Product Categories” @ Single Product Page

The WooCommerce Single Product page, on top of letting you add to cart the current item, also displays a list of related products and up-sells (when defined).

But what if you ALSO want to show a grid of “related product categories”, so that the customer can easily navigate to a category page instead of a single (related) product?

In this experiment, we will first calculate the current product’s categories, and then use a WooCommerce shortcode to output them as a grid, right below the related products section. Enjoy!

Continue reading WooCommerce: Display “Related Product Categories” @ Single Product Page

WooCommerce: Enhance Sales with AI-Powered Product Descriptions

In the fast-paced and highly competitive world of ecommerce, capturing customers’ attention and persuading them to make a purchase is crucial for driving sales.

One powerful tool that can help businesses achieve this is persuasive product descriptions.

In this blog post, we will explore the importance of compelling descriptions in boosting sales on WooCommerce, one of the most popular ecommerce platforms.

Moreover, we’ll dive into the exciting world of AI and discover how leveraging AI, particularly ChatGPT, can revolutionize the process of creating engaging product descriptions.

Continue reading WooCommerce: Enhance Sales with AI-Powered Product Descriptions

WooCommerce: Move Sale Badge Beside Price @ Single Product Page

On a default theme, such as Storefront, the single product page template is laid out so that the SALE badge comes first, on its own line, then comes the product title, the product price on its own line, the short description, the product’s stock availability and the add to cart button.

As you can see from the screenshot below, there is lots of white space on the right hand side, so for my new business line (WooCommerce Mini-Plugins, you somewhat guessed it, right?) I wanted to improve the single product page layout and move the SALE badge right beside the price, so that I could achieve two objectives: save some space, and also focus the customer attention on the product price as opposed on to the badge.

So, let’s see how I did it. Enjoy!

Continue reading WooCommerce: Move Sale Badge Beside Price @ Single Product Page

WooCommerce: Change “Buy Product” Label for External Products

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

WooCommerce: Count External Product Clicks

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

WooCommerce: Limit Sales Of A Product Per Day

Yes, “manage stock” is a nice feature to make sure you don’t oversell a given product based on the stock you have in your warehouse. However, what if you also need to have a “daily sales limit” – say you can’t sell more than 3 of a given product ID in a given day?

This is an interesting functionality that is also helpful for you to learn how to get today’s orders, how to loop through the orders to find a specific product ID and sum its quantities, and finally how to use the woocommerce_is_purchasable filter to set if a product can be purchased or not (which means, the add to cart may or may not show). Enjoy!

Continue reading WooCommerce: Limit Sales Of A Product Per Day

WooCommerce: Shoptimizer Theme Review

When building a WooCommerce store, one important factor to keep in mind is offering your customers seamless page navigation and design experience while ensuring faster page speed and performance. It helps boost customer satisfaction and improve business sales. 

According to Akamai’s research, even a 1-second delay affects the websites’ conversion rates by 7%, as your store’s page loading speed is one of the important determining Google’s SEO factors. 

Thus, to avoid delays and create a beautiful and appealing website, you must choose an excellent WooCommerce theme for your store. 

However, considering the wide range of options – selecting a multipurpose, user-friendly, and attractive WooCommerce theme can get challenging and overwhelming. Hence, today, in this article, we review one of the fastest WooCommerce themes – Shoptimizer

In this article, we’ll review the theme’s overview, interface, important features, and pricing to see if it’s the right fit for your WooCommerce store. Let’s begin! 

Continue reading WooCommerce: Shoptimizer Theme Review

WooCommerce: Populate Checkout Fields From URL

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

WooCommerce: Flatsome Theme Review

A remarkable and flawless user experience is the key to building a successful online presence for eCommerce businesses. How often do your customers enter your website, get distracted from running other errands, or abandon your store because of confusing age layouts?  

According to the statistics, 38% of site visitors stop engaging with websites due to unattractive content and page layout. Thus, attracting customers’ attention and offering a quality experience through an appealing and intuitive page design is important to ensure customer retention and increase sales.  

And your store’s theme is one important element that helps hold visitors’ interest and assist their page navigation. While you can choose from multiple themes for your WooCommerce website, choosing a multipurpose theme that delivers great performance, offers high customization abilities, and facilitates user experience is what you need to deliver a quality experience. 

This article reviews one such important theme – the Flatsome WordPress theme. We’ll start with its brief overview and see its interface, features, benefits, and cost to help you determine whether it’s the right choice for your eCommerce store. Let’s go!

Continue reading WooCommerce: Flatsome Theme Review

WooCommerce: 10 Crucial Issues That Should Be Fixed Right Now

I just spent the last 3 days in Porto with another 2,300 WordPressers at the first in-person WordCamp Europe since Berlin 2019. I had a blast, held a nice (yet long) workshop, spoke to many, but got tired too soon.

Later on, I realized that that tiredness was something more serious – in fact I tested positive against COVID for the first time in my life, and I’m now in self-isolation hoping it won’t last long… Another 7 days without my kid – send help!

Anyhow, what really struck me at WCEU 2022, and based on various chats and some data that I’ll share below, is that the WooCommerce ecosystem is in trouble.

A nicer way to put that? WooCommerce is not moving forward as fast as it should, and unless some key issues are addressed right now, in a few years time we all may pay the consequences.

Please note, this is not a rant. It’s a proper analysis, full of actionable information.

@ WooCommerce team - if you're reading this - my plan is to give you constructive feedback and tell you what the community (really) thinks, needs and wants, so that you can get a better picture of the current situation. I know you've already started working on this, so this is just a recap/reminder and a way to get the whole community realigned. 

In this post, I will share my worries, my fears, the current WooCommerce issues, some data I collected at WCEU 2022 and then a list of actionable solutions that may be implemented in order to clear the backlog and get back on track – asap. Enjoy!

Continue reading WooCommerce: 10 Crucial Issues That Should Be Fixed Right Now

WooCommerce: How to Split Variable Products Into Simple Products

If you sell simple products with no variations like books or software – the standard WooCommerce product page is enough and an ideal solution for your WooCommerce store. However, it isn’t the best solution for stores that sell variable products with multiple product variations. 

A variable product comes in different variations. A simple example is clothing items, including a shirt – with multiple variation attributes like size, color, and pattern. So, if a shirt is a variable product – a medium-sized shirt, small-sized yellow shirt, or large-sized printed shirt are its product variations.  

Thus, a product variation is the final product choice of the customer once they select multiple attributes belonging to a variable product. 

By default, WooCommerce displays all your variable products as just that – products with multiple different variations on its shop page. However, you might need a way to display each product variation as an individual product on your WooCommerce shop page to improve customer experience, search functionality and increase overall sales. 

So, in this article, we’ll see different ways through which you can split your variable products to show them as a single variation product on your WooCommerce store. But first, let’s see how this process can help your store’s bottom line. 

Continue reading WooCommerce: How to Split Variable Products Into Simple Products

WooCommerce: Replace Variable Price With Active Variation Price

Surprisingly enough, variable products with a price range display two prices: at the top right you find the “parent” product price, displayed as a range; but once you select a variation, a second price appear just above the variation add to cart. Somewhat confusing.

In today’s solution, we’ll see once and for all how to replace the top right variable product price with the one of the current variation, while also hiding the variation price. Therefore, you’ll see a single price on the single product page for variable products. Enjoy!

Continue reading WooCommerce: Replace Variable Price With Active Variation Price

WooCommerce: User Can Only Purchase A Product Once

In the era of online courses, subscriptions, custom-made products and product personalization, it may happen that you need to limit a specific WooCommerce product sales. For example – users may only purchase a trial 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 before proceeding with the order.

Enjoy!

Continue reading WooCommerce: User Can Only Purchase A Product Once

WooCommerce: Remove “Clear” Button @ Variable Product Page

As soon as you select a product attribute (by default, this is a dropdown right above the variation add to cart button), a “Clear” button appears beside the dropdown/s in order to reset the selection/s and start anew.

As usual, some WooCommerce store owners may require to hide/delete such link, and this is why your truly is here: why “display:none” stuff with CSS when you’re not actually removing it completely from the code? Which means, there must be a PHP way.

And, once again, here comes a 1-line snippet. Enjoy!

Continue reading WooCommerce: Remove “Clear” Button @ Variable Product Page

WooCommerce: How to Create A Private Store

WooCommerce powers over 26% of global eCommerce websites and is an excellent and convenient way to create your online shop without writing a single line of code.  

But besides its convenience – another factor that makes WooCommerce a popular choice is its flexibility. While the core WooCommerce installation helps you create a basic online store with ease – specific paid WooCommerce plugins make it easy to create a customized and ideal business model of your choice. 

For instance, several businesses prefer a private WooCommerce store model to grant access or sell products and services to specific customers and hide from the others. This is where a private store for WooCommerce plugins comes into the picture. 

A great example is Oriflame – a direct sales leading beauty company that sells products for everyone and reserves some for specific VIP members on their website. They offer benefits like exclusive discounts, access to a complete range of products, and fast delivery to these VIP members. 

There can be multiple other reasons behind creating a private WooCommerce store. In this article, we’ll briefly touch on those reasons and share some of the best WooCommerce private store plugins you can use for your WooCommerce store. Let’s go!

Continue reading WooCommerce: How to Create A Private Store

WooCommerce: How to Get Started with WooCommerce Blocks – PART 2

WooCommerce is one of the leading eCommerce platforms marking its territory in the eCommerce industry one website at a time – with over 5 million downloads. It offers a complete online store solution for small and medium-sized businesses and web professionals.       

And now, the development team is working at making WooCommerce fully compatible with Gutenberg. And the first phase is about building custom WooCommerce Blocks that can be used in the new WordPress editor.

These blocks come free of cost and let you customize and change the complete look and feel of your WooCommerce store – without typing a single line of code. With a simple drag and drop tool – you can place your store products wherever on the website in whichever desired format.

In part 1 of this article we saw ten WooCommerce blocks and their significance. In this article, we’ll talk about ten more blocks you can use for an interactive online store. But first, let’s learn about adding and editing these blocks on your store. 

Continue reading WooCommerce: How to Get Started with WooCommerce Blocks – PART 2