← Back to documentation

Add these snippets to your child theme’s functions.php file or use a plugin such as Code Snippets ↗. Avoid adding custom code directly to the parent theme’s functions.php file, as it will be overwritten by theme updates. Replace the values highlighted in red with your own custom values.

Customize “Unvailable” text

add_filter( 'nshk_easy_scheduling_out_of_stock_text', 'easy_scheduling_custom_out_of_stock_text', 10, 2 );

function easy_scheduling_custom_out_of_stock_text( $text, $product_id ) {
return __( 'Unvailable', 'noushka-easy-scheduling' );
}

Customize “Only 1 available” text

First value is singular, second value is plural form. “%s” corresponds to the amount available.

add_filter( 'nshk_easy_scheduling_low_stock_text', 'easy_scheduling_custom_low_stock_text', 10, 2 );

function easy_scheduling_custom_low_stock_text( $text, $product_id ) {

return [
__( 'Only %s available', 'noushka-easy-scheduling' ),
__( 'Only %s available', 'noushka-easy-scheduling' )
];

}

Customize “1 available” text

First value is singular, second value is plural form. “%s” corresponds to the amount available.

add_filter( 'nshk_easy_scheduling_stock_text', 'easy_scheduling_custom_stock_text', 10, 2 );

function easy_scheduling_custom_stock_text( $text, $product_id ) {

return [
__( '%s available', 'noushka-easy-scheduling' ),
__( '%s available', 'noushka-easy-scheduling' )
];

}

Customize “Available” text

add_filter( 'nshk_easy_scheduling_in_stock_text', 'easy_scheduling_custom_in_stock_text', 10, 2 );

function easy_scheduling_custom_in_stock_text( $text, $product_id ) {
return __( 'Available', 'noushka-easy-scheduling' );
}

Remove WooCommerce stock text on product pages

Add this code snippet to hide stock text displayed above date and time pickers after time selection.

add_filter( 'nshk_easy_scheduling_hide_woocommerce_stock_text', '__return_true' );