strangerstudios / pmpro-woocommerce

Connect Paid Memberships Pro with WooCommerce and WooCommerce Subscriptions to sell membership products and offer members-only product discounts.
https://www.paidmembershipspro.com/add-ons/pmpro-woocommerce/
46 stars 32 forks source link

[POC] Fix false warnings for the is_purchase on cart page #203

Closed andrewlimaza closed 4 months ago

andrewlimaza commented 5 months ago

I think it may be better to figure out this in the pmprowoo_cart_has_membership() has more than one membership level in the cart when on the cart or checkout page and doesn't allow multiple checkouts in the group settings.

The logic here would assume if we make it to the checkout or cart page that things are okay because it seems that the logic checks this more than once while on the cart page causing the false positive. I do think we need a special check for when viewing the cart or checkout page and making sure all the products are still purchasable.

This is a proof of concept for now and may not fully function correctly in some cases but it is a good starting point.

All Submissions: