Created
October 5, 2023 10:29
-
-
Save hslaszlo/3aad1609311bcfbefb1308c784a6a7f4 to your computer and use it in GitHub Desktop.
Change Out of Stock Text in WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_get_availability_text', 'themeprefix_change_soldout', 10, 2 ); | |
/** | |
* Change Sold Out Text to Something Else | |
*/ | |
function themeprefix_change_soldout ( $text, $product) { | |
if ( !$product->is_in_stock() ) { | |
$text = '<div class="">Sold out.</div>'; | |
} | |
return $text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment