WordPress.org

Forums

WooCommerce - excelling eCommerce
Disable other product / Hide "Add To Cart" after insert 1 product in cart (3 posts)

  1. paanmfr
    Member
    Posted 1 year ago #

    Hi there,

    Need help on setting filter / action to remove or disable "add to cart" after a selected product is added to the cart.

    Theres a series of product.. Product A, Product B, Product C, and other products..

    If either one of these product was added to the cart, the whole store "add to cart" button will be remove or hidden or disable.

    Thank you.

    http://wordpress.org/plugins/woocommerce/

  2. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    You can check what is in the cart with $woocommerce->cart->cart_contents. Then remove the add to cart using remove_action() (see woocommerce-hooks.php).

    Thx

  3. paanmfr
    Member
    Posted 1 year ago #

    Thanks Jameskoster

    Functions added and worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.