mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-28 11:22:21 +08:00
8 lines
337 B
Text
8 lines
337 B
Text
add_filter( 'woocommerce_get_availability', 'change_out_of_stock_text_woocommerce', 1, 2 );
|
|
function change_out_of_stock_text_woocommerce( $availability, $product_to_check ) {
|
|
// Change Out of Stock Text
|
|
if ( ! $product_to_check->is_in_stock() ) {
|
|
$availability['availability'] = __('SOLD', 'woocommerce');
|
|
}
|
|
return $availability;
|
|
}
|