Your Dedicated Partner for All Things WordPress

How to Change the Backorder Text in WooCommerce

Table of Contents

WooCommerce is a popular e-commerce platform that allows businesses to sell their products online. One of the features that comes with WooCommerce is the ability to track stock of products and allow customers to purchase items even if they’re out of stock. This is called a backorder. However, by default, the text that’s displayed when a product is on backorder can be confusing or not fitting for your brand. This blog post will guide you on how to change the backorder text in WooCommerce so you can customize it to suit your business needs.

Step 1: Install the Code Snippets Plugin

To begin, you need to install the Code Snippets plugin. This plugin allows you to add custom code to your website without directly editing the theme files. Code snippets are small bits of code that add functionality to a website. You can add code snippets for WooCommerce as well as other aspects of your website. Once you’ve installed the Code Snippets plugin, activate it on your website.

Step 2: Add the Custom PHP Code

In the Code Snippets plugin, click on “Add New Snippet” to add a new code snippet. Give your snippet a name and copy and paste the following code into the code box:

add_filter(‘woocommerce_get_availability_text’, ‘change_backorder_text’, 10, 2);
function change_backorder_text($availability, $product) {
if ($product->backorders_allowed() && $product->is_on_backorder(1)) {
$availability = __(‘Available on backorder’, ‘woocommerce’);
$availability = ”;
}
return $availability;
}

This code changes the backorder text from “Out of Stock” to “Available on backorder” for products that are on backorder.

Step 3: Save and Activate the Code Snippet

Save the code snippet and activate it on your website. You should now see the new backorder text on your product pages.

Step 4: Customize the Backorder Text

If you want to change the backorder text to something else, you can edit the code snippet. For example, to change the backorder text to “Pre-order Now”, you would replace “Available on backorder” with “Pre-order Now”.

Conclusion

Customizing the backorder text in WooCommerce is a great way to add a personal touch to your website and improve the customer’s shopping experience. By following the steps outlined in this blog post, you can easily change the default backorder text to something that suits your brand and communicate with your customers more effectively. Remember to test the changes on a staging site before deploying them to your live website. Happy customizing!

How to get started?

Learn more

WooCommerce Maintenance

Save 33% with our Annual pricing plan.

Get Started

Looking for help? Chat with us.

Are you in need of assistance or guidance? Look no further! Our dedicated team is here and ready to help. Chat with us today and let’s work together to find the perfect solution for your needs.

Our support team will get you:

I believe every website owner deserves a reliable professional support always by their side.

Alexey Seryapin
Founder of WPServices

Having Troubles With WordPress?

Claim Your Free WordPress Maintenance

In today’s fast-paced digital landscape, every website deserves the care and expertise of a professional maintenance team, ensuring optimal performance, enhanced security, and seamless user experiences, so you can focus on growing your business with peace of mind.

Alexey Seryapin
Founder of WPServices

Coupon Code Applied!

Take your time and continue browsing our services.

Alexey Seryapin
Founder of WPServices