How to hide the ” add to cart” for some products in the product archive?
-
Hi,
I am publishing the products without price, only the “get a quote”, so how to hide the ” add to cart” icon in the product archive page?
Thanks very much.
Kindly pls find the attached screenshot for detail.
Best regards
Cathy
Attachments:
You must be
logged in to view attached files.
Hello,
Use the code below for help:
.wd-product.wd-hover-icons .wd-buttons .wd-add-btn {
display: none;
}
Define it in Theme Settings -> Custom CSS.
Kind Regards
Hello,
Add the code below to the functions.php file in your child theme and check how it works.
if (!function_exists('woocommerce_template_loop_add_to_cart')) {
function woocommerce_template_loop_add_to_cart() {
global $product;
if ( ! $product->is_in_stock() || ! $product->is_purchasable() ) return;
wc_get_template('loop/add-to-cart.php');
}
}
Best Regards,
Hi, THANKS VERY MUCH, IT WORKS , AFTER i ADD THE .wd-product.wd-hover-icons .wd-buttons .wd-add-btn {
display: none;
}.
thanks very much!
Hello,
Thank you for confirming that the provided solution worked for you. If you have any more questions or need further assistance, feel free to reach out. We are here to help.
Best regards
The topic ‘How to hide the ” add to cart” for some products in the product archive?’ is closed to new replies.