Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-work discounting while membership in cart logic and discounting membership products. [Discussion] #148

Open
andrewlimaza opened this issue Jan 12, 2021 · 3 comments

Comments

@andrewlimaza
Copy link
Collaborator

Currently, as of this writing, the Paid Memberships Pro - WooCommerce Integration should not discount membership products with the current level discount or the level product in the cart discount and currently takes the level product in the cart discount as a priority over the currently held membership level of the user.

This is not a feature request but more of a discussion for the community to engage in and help decide on a path forward. Please note that this may not ever be included in a future release of the Paid Memberships Pro WooCommerce Integration

Some steps to recreate this functionality:

  1. Currently hold a membership level that has 10% off all products.
  2. Add general products (this will be 10% off).
  3. Add a membership product to the cart, with a higher or less discount setting (i.e. 5%) and now the products will be discounted at 5%.

The question here is, should we take the current user's level as a priority into consideration or the level in the cart? A guide may be created soon to support this change for user's that may be using Multiple Memberships Per User (MMPU) and want the current level held discount to take priority. Also with regards to MMPU, we should possibly figure out the highest discount rate and use that as a priority if a user has multiple levels at the same time.

Discounting membership products:

This may be an easier fix by adding in an option or filter (for developers) to allow membership product types to be discounted based on the user's level. This makes more sense if you apply the current user's membership level discount settings as a priority, which may allow existing member's a prorated value when 'upgrading' or 'downgrading' from their current membership level.

@jpaezsa
Copy link

jpaezsa commented Mar 12, 2021

Please remove this because nobody like just for adding a membership to the cart discount at "X" percent of a single product before the client paid "that membership"

Do you can help me to add a function to disable this!.

@andrewlimaza
Copy link
Collaborator Author

@jpaezsa The idea here is to allow people to purchase the membership level and receive the discount associated with that level within a single checkout to ensure customer's don't need to do multiple checkouts to receive the discount.

I do think it would be a good idea to allow developers to turn this off.

@andrewlimaza
Copy link
Collaborator Author

The solution would be to add in a filter along the lines of pmpro_woo_cart_level_discount that would allow you to turn this on/off.

For interest sake here's the logic -

// Search for any membership level products. IF found, use first one as the cart membership level.
foreach ( $items as $item ) {
if ( in_array( $item['product_id'], $membership_product_ids ) ) {
$cart_membership_level = $pmprowoo_product_levels[ $item['product_id'] ];
break;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants