Home Forums WoodMart support forum How to hide the ” add to cart” for some products in the product archive?

How to hide the ” add to cart” for some products in the product archive?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #669889

    springorchid2008
    Participant

    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.
    #669947

    Luke Nielsen
    Keymaster

    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

    #669953

    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,

    #670186

    springorchid2008
    Participant

    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!

    #670440

    Luke Nielsen
    Keymaster

    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

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘How to hide the ” add to cart” for some products in the product archive?’ is closed to new replies.