• Resolved charliesjc

    (@charliesjc)


    Hi,
    I’ve changed the text for some of my products to “Sold” instead of simply “Out of Stock”, which is exactly what I wanted. The only problem is that it only shows the new “Sold” label on the product page. On the shop page on the image thumbnail it still shows the “out of stock” badge. Is that a plugin issue or is it likely my theme? I’m using OceanWP.

    It also still shows Out of Stock on the admin page side, I assume that is on purpose though because the original 3 Woocommerce statuses are still what controls the inventory?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter charliesjc

    (@charliesjc)

    Okay so I solved this one. OceanWP doesn’t seem to use the built in Woocommerce out-of-stock text and uses it’s own. So I wrote the following addition to the filter mentioned in the OceanWP docs to fix my problem and keep the text up-to-date when I, or your plugin, change the woocommerce out-of-stock text:

    function my_woo_outofstock_text( $text ) {
        global $product;
        $newtext = $product -> get_availability();
        $text = __( $newtext['availability'], 'ocean' );
    	return $text;
    }
    add_filter( 'ocean_woo_outofstock_text', 'my_woo_outofstock_text', 20 );

    This is obviously not an issue on your plugin’s side at all but I thought I’d post the solution if someone else stumbled onto this.

    Plugin Author Softound Solutions

    (@softound)

    Okay, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Text not changing on product badge’ is closed to new replies.