Skip to content

Instantly share code, notes, and snippets.

@Kodzhesyan
Last active March 5, 2023 17:07
Show Gist options
  • Save Kodzhesyan/82c2ba0693e063d6dfba3764d317ee04 to your computer and use it in GitHub Desktop.
Save Kodzhesyan/82c2ba0693e063d6dfba3764d317ee04 to your computer and use it in GitHub Desktop.
Плашка "в наявності"
<?
//Додаємо плашку "В налявності" на сторінці товару WooCommerce
add_filter( 'woocommerce_get_availability', 'custom_override_get_availability', 10, 2);
function custom_override_get_availability( $availability, $_product ) {
if ( $_product->is_in_stock() ) $availability['availability'] = __('В наявності', 'woocommerce');
return $availability;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment