Skip to content

PayPal Payments is forcing all products to be sold individually #2462

@james-allan

Description

@james-allan

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

  1. Go to Products > Add new
  2. Enter a product name and price.
  3. Go to the Inventory tab.
  4. Make sure that Sold individually is unchecked.
  5. Save the product.
  6. 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:

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. -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionA suggestion for a change or new feature without too many details

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions