BUG FIX: Fixes a bug where products that can only be purchased one per cart would incorrectly not allowed to be purchased even if it was the only membership product in the cart.
Hooking into wp allows us to use the is_cart and is_checkout functions from WooCommerce to avoid this error. Admins/Shop Owners should also limit purchases for products that should only be purchased one per cart within the "inventory" settings of WooCommerce.
For some reason the 'is_purchasable' was running multiple times on the checkout and cart page due to our updated code.
Hooking into
wp
allows us to use theis_cart
andis_checkout
functions from WooCommerce to avoid this error. Admins/Shop Owners should also limit purchases for products that should only be purchased one per cart within the "inventory" settings of WooCommerce.For some reason the 'is_purchasable' was running multiple times on the checkout and cart page due to our updated code.