-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Describe the Bug
In the #2265 PR, PayPal Payments includes code which forces all products to be sold individually.
Looking at the PR, it looks like the intention was for this to only affect subscription products, however it's impacting all product types.
To Reproduce
Based on user reports
- Go to Products > Add new
- Enter a product name and price.
- Go to the Inventory tab.
- Make sure that Sold individually is unchecked.
- Save the product.
- View the Inventory tab and notice that the product is sold individually.
Expected Behavior
The sold individually setting should reflect the user's choice, rather than being forced either way.
Actual Behavior
PayPal Payments is setting it to true via this code:
woocommerce-paypal-payments/modules/ppcp-paypal-subscriptions/src/PayPalSubscriptionsModule.php
Lines 720 to 722 in f52b01b
| if ( ! $product->get_sold_individually() ) { | |
| $product->set_sold_individually( true ); | |
| } |
Note that that code runs before you've determined if it's a subscription product.
Note
I'm not even sure forcing this setting to be on for subscription products is correct either. If a store offers multiple payment methods, forcing all subscriptions to be sold individually because PayPal is installed seems a little heavy handed. Having said that, there's more to this as I could see customers placing multiple subscriptions in the cart and then having no eligible payment methods on stores that exclusively offer PayPal. Probably something to consider though.
Environment
- WordPress Version
- WooCommerce Version
- Plugin Version
- Browser [e.g. Chrome, Safari] and Version
- Any other plugins installed
Additional Details
System status
<!--If applicable, paste the system status here. Please ensure you redact or remove any identifying information. -->