//Срыть кнопку в shop и product_category
add_action( 'woocommerce_after_shop_loop_item', 'remove_add_to_cart_buttons', 1 );
function remove_add_to_cart_buttons() {
if( is_product_category() || is_shop()) {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
}
}
// Поменять кнопку в магазине и архивах
add_filter( 'woocommerce_loop_add_to_cart_link',
'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
if ( method_exists( $product, 'get_id' ) ) {
$product_id = $product->get_id();
} else {
$product_id = $product->id;
}
if ( has_term( 'categ1', 'product_cat', $product_id ) && $product->is_type( 'simple') ) {
// Set HERE your button link
$link = get_permalink($product_id);
$html = '<a href="'.$link.'" class="button alt add_to_cart_button">'.__("Подробнее...", "woocommerce").'</a>';
}
return $html;
}
var wpcf7Elm = document.querySelector( '.wpcf7' );
wpcf7Elm.addEventListener( 'wpcf7submit', function( event ) {
//Что тут?
}, false );