Skip to content

Instantly share code, notes, and snippets.

View phonoxify's full-sized avatar

Jannik Nefferdorf phonoxify

  • Karlsruhe, Germany
View GitHub Profile
@damiencarbery
damiencarbery / check-hire-category.php
Last active November 23, 2024 19:22
Change Flatsome theme 'Out of Stock' label to 'Sold' - Change the 'Out of stock' banner in Flatsome theme to 'Sold'. https://www.damiencarbery.com/2020/06/change-flatsome-theme-out-of-stock-label-to-sold/
<?php
// Check for 'Hire' category for single product.
add_filter( 'dcwd_single_product_availability_text', 'dcwd_single_product_availability_check', 10, 2 );
function dcwd_single_product_availability_check( $availability_text, $product ) {
if ( has_term( array( 'hire' ), 'product_cat', $product->get_id() ) ) {
return 'Unavailable';
}
else {
return 'Sold';