Это наш существующий PHP, который меняет текст кнопки. [взято из другого места в StackOverFlow]
Код: Выделить всё
/**
* @snippet Read more > Out of stock @ WooCommerce Shop
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @testedwith WooCommerce 5
* @community https://businessbloomer.com/club/
* See: https://www.businessbloomer.com/woocommerce-rename-read-more-out-of-stock-shop/
*/
add_filter( 'woocommerce_product_add_to_cart_text', 'bbloomer_archive_custom_cart_button_text' );
function bbloomer_archive_custom_cart_button_text( $text ) {
global $product;
if ( $product && ! $product->is_purchasable() ) { /* original example was: ! $product->is_in_stock() */
return 'Active';
}
return $text;
}
Код: Выделить всё
£0.00
for 2 years
[url=.../membership/arts-events-marketing-subscription-copy/]Active[/url]
Подробнее здесь: [url]https://stackoverflow.com/questions/79224878/how-add-a-class-to-an-a-element-using-php[/url]
Мобильная версия