David
asked 8 years ago

I have a donation section to my site that is located at root/donate/

I would like the shopping cart to not be visible on pages in that area.

3 Answers
DominicStaff
answered 8 years ago

I’m not sure about your question. However, if you want to hide the shopping cart button (Add to card) button in your site, you can add the following code to the functions.php file:

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );

If it’s not your question that you mentioned here, please clarify your question and send me a screenshot for further checking.
Hope this helps !

david rummelhoff
replied 8 years ago

That is helpful, but i need it to be conditional.

IF page is… THEN remove shopping cart

I could manually pick the pages by id or slug to place within the IF statement.

David
answered 8 years ago

I don’t want the Quick View/MiniCart button to appear if the page is

example.com/donate/
OR
example.com/donate/this-cause/

DominicStaff
answered 8 years ago

If you want to remove Quick View/MiniCart button in the each page, you can add the following code to the functions.php file and find your Page ID and from back-end and Replace the ID word.

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10, ID);
remove_action( 'woocommerce_after_shop_loop_item', 'dwqv_add_button', 15, ID );
david rummelhoff
replied 8 years ago

That doesn’t work.

dominic Staff
replied 8 years ago

please send me username & password of your site for further checking, I have checked on our demo and it still works fine.

Powered by DW Question & Answer Pro