Hello
I need to hide the price and add to cart for specific products.
I tried to use this code below but its not working I think becouse of wrong webhooks. Could you please check it and tell me if I need to correct it? Thx
function custom_hide_price_add_cart_buttons() {
global $product;
// Array of product IDs for which you want to hide the price and add to cart button
$product_ids_to_hide = [105088];
if ( in_array( $product->get_id(), $product_ids_to_hide ) ) {
remove_action( ‘etheme_woocommerce_template_single_add_to_cart’, ‘woocommerce_template_single_add_to_cart’, 30 );
remove_action( ‘etheme_woocommerce_template_single_price’, ‘woocommerce_template_single_price’, 10 );
}
}
// Hook for single product pages
add_action(‘etheme_woocommerce_before_single_product’, ‘custom_hide_price_add_cart_buttons’);