Home › Forums › WoodMart support forum › Replace add to cart button with JS › Reply To: Replace add to cart button with JS
March 5, 2024 at 9:56 am
#546219
v1ppers0nn
Participant
Hi, i found an method to change the url of add to cart, but i cant make it on the homepage. Do you know what is the tag for homepage? I am usign this:
add_filter(‘woocommerce_is_purchasable’, ‘hide_add_to_cart_category’, 99 );
function hide_add_to_cart_category ($hide) {
//short-hand version
//return $hide = is_product_category() ? false : true;
if ( is_product_category() || is_shop()) {
$hide = false;
} else {
$hide = true;
}
return $hide;
}
Is working on category pages, but i want also in homepage.
Thanks.