• Resolved passiondesigns

    (@passiondesigns)


    Hi, I want to remove the add to cart button that is found on the shop page of my website, using woocommerce but NOT from the product pages themselves. I have tried a few options out there to no avail, and so I wonder if my theme is over-riding this somehow?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Mirko P.

    (@rainfallnixfig)

    Hello @passiondesigns,

    If I understand correctly, you’d like to remove the Add to Cart button from the shop page only. If so, at this moment, this feature is not available with core WooCommerce but I found this snippet that can help achieve your goal.

    It will remove the button both in the shop and in the product categories. To remove it only on the shop page use this snippet:

    add_action( 'woocommerce_after_shop_loop_item', 'remove_add_to_cart_buttons', 1 );
    
        function remove_add_to_cart_buttons() {
          if( is_shop()) { 
            remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
          }
        }

    Add the code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code Snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

    Hope this helps.

    Thread Starter passiondesigns

    (@passiondesigns)

    Hi Mirko, thanks so much. This fixed the issue on all of the category pages, but on the main page where all categories are shown, it still shows the add to cart button. How can I get it to go away here?

    Mirko P.

    (@rainfallnixfig)

    Hi @passiondesigns,

    Can you share a link to the page where you want the add to cart button to be removed?

    Another possibility would be hiding it using CSS but we need to check the output.

    Cheers.

    Thread Starter passiondesigns

    (@passiondesigns)

    Hi, thanks for your reply, this is the page I want Add to cart removed: https://gx8.217.myftpupload.com/shop/
    thanks!

    Thread Starter passiondesigns

    (@passiondesigns)

    Halfway down this page it says “Showing all 9 Results”.. and this section shows everything correct. Is there a way to remove the top portion that is almost a repeat of all the items?

    Mirko P.

    (@rainfallnixfig)

    Hi @passiondesigns,

    This can be fixed with some custom CSS. Under Appearance > Customize > Additional CSS, you can add the following code:

    .wp-block-woocommerce-all-products .add_to_cart_button {
    display: none !important;
    }

    For continued support with customizations, we’d recommend hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Cheers!

    Thread Starter passiondesigns

    (@passiondesigns)

    Awesome, thanks Mirko. That removed the add to cart button for the remaining items. Lastly, can you help with getting rid of the duplicate showing of items on this page?

    Thread Starter passiondesigns

    (@passiondesigns)

    I would like to get rid of the set shown first.

    Mirko P.

    (@rainfallnixfig)

    Hey @passiondesigns,

    Please try this CSS.

    .woocommerce-shop .woocommerce-products-header .page-description {
    display: none;
    }

    For further assistance, please contact our customization experts. They will help you better customize your site.

    Cheers.

    Thread Starter passiondesigns

    (@passiondesigns)

    Lifesaver! Thanks so much!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove Add to Cart button from Shop Page, NOT Individual product pages’ is closed to new replies.