当产品缺货单页显示notify woocommerce时,我正在执行此代码,但只显示按钮存档页,我想显示单页任何一个代码帮助https://imgur.com/dKmlKgM
add_filter( \'woocommerce_loop_add_to_cart_link\', \'filter_loop_add_to_cart_link\', 20, 3 );
function filter_loop_add_to_cart_link( $button, $product, $args = array() ) {
if( $product->is_in_stock() ) return $button;
// HERE set your button text (when product is not on stock)
$button_text = __(\'Not available\', \'woocommerce\');
return sprintf( \'<a class="button disabled" style="%s">%s</a>\', $style, $button_text );
}