Available on backorder

Hey, I would like to change the Available on backorder text to Available on backorder, We will ship as soon as possible. I would also like this font to be bold and a different color. Hex code #ea6500 How can I do this?

Hello @odsadmin,

Thanks for asking. :slight_smile:

Please note that changing backorder text will require changes in theme files. In that regards I suggest you to install and setup child theme. You can use following resources to download and setup child theme.

Download Child theme from following source: https://theme.co/apex/child-themes

Please take a look at following article to setup child theme:

Next, please take a look at solution mentioned in following article.

Thanks.

I currently have a Child theme so all I need to do is put this in the Function.PHP file?

function backorder_text($availability) {

foreach($availability as $i) {

//$availability = str_replace(‘Available on backorder’, ‘Yo, allow 3-4 weeks for your shiz!’, $availability);

$availability = str_replace(‘Available on backorder’, ‘This item may take 3-4 weeks to deliver’, $availability);

}

return $availability;
}
add_filter(‘woocommerce_get_availability’, ‘backorder_text’);

After I do that how can I change the color to Orange?

Hey @odsadmin,

Yes, that is correct. Please watch the screencast at https://youtu.be/6RirsOVE1Og to see the usage. Below is the CSS code you need to add in Theme Options > CSS to turn the text to orange and bold.

.available-on-backorder {
  color:#ea6500;
  font-weight:bold
}

Please additionally note that what we’ve shown here is only a guide. Issues that might arise and further enhancing the code from this guide would be outside the scope of our support. For that, you’ll need to forward this to a third party developer.

Hope that helps and thank you for understanding.

OMG!! You are amazing. Thank you sooooo much.

You’re welcome.

Can I change the text for this as well? In stock (can be backordered) I really don’t like that it says this when the items are in stock. Can I just remove that? It seems to put this on the items I make Allow, but notify customer. I like this option but don’t like this text. Only like it when the out of stock text shows when they are out of stock.

Hi @odsadmin,

Sure, please check this https://www.sellwithwp.com/remove-woocommerce-stock-labels/.

And you can add the code suggested on that page.

Thanks!

It’s the In Stock I want to remove its when You put the item as Allow, but notify customer. When the item is in stock it say In stock (can be backordered). Thats what I want to remove. I don’t believe this is the same code needed.

Hello @ODSAdmin,

Please have your code updated and use this instead:

function backorder_text($availability) {

  foreach($availability as $i) {

    $availability = str_replace('Available on backorder', 'This item may take 3-4 weeks to deliver', $availability);

    $availability = str_replace('In Stock', 'Can be backordered', $availability);

  }

  return $availability;
}
add_filter('woocommerce_get_availability', 'backorder_text');

We would loved to know if this has work for you. Thank you.

This did not work. :frowning:

function backorder_text($availability) {

foreach($availability as $i) {

$availability = str_replace('Available on backorder', 'This item is on backorder. We will ship as soon as the item is in stock.', $availability);

$availability = str_replace('In Stock', 'Can be backordered', $availability);

}

return $availability;
}
add_filter(‘woocommerce_get_availability’, ‘backorder_text’);

This is what I added. Here is a link you can see what I am talking about. https://www.outdoordogsupply.com/product/refurbished-garmin-alpha-100-handheld-3yu/

The Text that says In stock (can be backordered). I would like this removed. I dont think it should say this if its in stock. I dont want it to say anything. Only when it is out of stock should it notify the customer.

Hi @odsadmin,

Please try this https://stackoverflow.com/questions/51937649/remove-can-be-backordered-from-product-page-stock-display-in-woocommerce

And instead of replacing (can be backordered), just replace the entire text. Like,

add_filter( 'woocommerce_get_availability_text', 'filter_product_availability_text', 10, 2 );
function filter_product_availability_text( $availability, $product ) {

    if( $product->backorders_require_notification() ) {
        $availability = str_replace('In stock (can be backordered)', '', $availability);
    }
    return $availability;
}

And this looks like Woocommerce Backorder plugin related, I recommend contacting them for further information.

Hope this helps.

So I keep this and add the code Rad sent me?

function backorder_text($availability) {

foreach($availability as $i) {

//$availability = str_replace(‘Available on backorder’, ‘Yo, allow 3-4 weeks for your shiz!’, $availability);

$availability = str_replace(‘Available on backorder’, ‘This item is on backorder. We will ship as soon as the item is in stock.’, $availability);

}

return $availability;
}
add_filter(‘woocommerce_get_availability’, ‘backorder_text’);

Add this?

add_filter( ‘woocommerce_get_availability_text’, ‘filter_product_availability_text’, 10, 2 );
function filter_product_availability_text( $availability, $product ) {

if( $product->backorders_require_notification() ) {
    $availability = str_replace('In stock (can be backordered)', '', $availability);
}
return $availability;

}

I need to use both?

Hi There,

You should keep both of them.

We can’t continue providing the custom code for you since this is related to the 3rd party plugin.

Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer or plugin author.

Thank for understanding!

This worked great. Thank you so much for the help!!

You’re more than welcome, glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.