Skip to main content

With this filter you can control the output of the buttons. A possible case would be, to hide the buy-button for certain products on certain pages. Almost anything is possible. As Value we deliver the current Text ($text), the current product-ID ($post_id) and the current position ($pos), e.g. Details button ($pos == 'detail') or Buy button ($pos == 'buy').

add_filter('at_product_button', 'at_hide_product_button', 11, 3);
function at_hide_product_button($text, $post_id, $pos) {
	if(is_tax() && $pos == 'buy') {
		return false;
	}

	return $text;
}

Was this article helpful?

1 Star2 Stars3 Stars4 Stars5 Stars
(No Ratings Yet)

Keine Kommentare vorhanden


You have a question or an opinion about this post? Share it with us!

Your email address will not be published. Required fields are marked *

*
*