Home Forums WoodMart support forum How to disable add to cart

How to disable add to cart

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #697795

    pudelis
    Participant

    Hi, we have some categories products wich has price, but we dont want to let clients to buy them.
    https://woocommerce-1526781-5928971.cloudwaysapps.com/kategorija/audiniai/uzsakomieji/

    On single product layout we figure out, but how about archive page? there are still button add to cart if we add prices.

    Attachments:
    You must be logged in to view attached files.
    #697904

    Hello,

    Try to add the following custom css code in Theme Settings > Custom CSS:

    body.term-uzsakomieji .add_to_cart_button,
    body.term-uzsakomieji .product_type_simple,
    body.term-uzsakomieji .product_type_variable,
    body.term-uzsakomieji a.button {
        display: none !important;
    }

    Best Regards,

    #697928

    pudelis
    Participant

    How to add also in this category and subcategories?
    https://woocommerce-1526781-5928971.cloudwaysapps.com/kategorija/romanetes/

    #697995

    Hello,

    To apply the same rule to multiple categories and their subcategories, you just need to target all the category slugs in the body class.

    For example, for this category:

    “Romanetes”, You can use this:

    body.term-romanetes .add_to_cart_button,
    body.term-romanetes .product_type_simple,
    body.term-romanetes .product_type_variable,
    body.term-romanetes a.button {
        display: none !important;
    }

    Best Regards,

    #697998

    pudelis
    Participant

    So later we can add any term to this css with subcategories also?
    For example by same logic?

    body.term- .add_to_cart_button,
    body.term-mechanizmas-uzuolaida-sirma .product_type_simple,
    body.term-mechanizmas-uzuolaida-sirma .product_type_variable,
    body.term-mechanizmas-uzuolaida-sirma a.button {
    display: none !important;
    }

    #698009

    Hello,

    Yes, exactly — you can add any category or subcategory slug the same way.

    Just copy the block and replace the slug:

    body.term-mechanizmas-uzuolaida-sirma .add_to_cart_button,
    body.term-mechanizmas-uzuolaida-sirma .product_type_simple,
    body.term-mechanizmas-uzuolaida-sirma .product_type_variable,
    body.term-mechanizmas-uzuolaida-sirma a.button {
        display: none !important;
    }

    Best Regards,

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