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

Add support for signup fee coupons during subscription switches #751

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

annemirasol
Copy link
Contributor

@annemirasol annemirasol commented Dec 18, 2024

Fixes #726

Description

This PR adds support for signup fee coupon during subscription switches. It computes for the actual signup fee amount and applies the discount to that amount.

How to test this PR

  1. Go to WooCommerce > Settings > Subscriptions > Switching, and
    • Enable Allow Switching: Between Subscription Variations.
    • For Prorate Recurring Payment: For Upgrades and Downgrades of All Subscription Products
    • For Prorate Signup Fee: Never (charge the full signup fee)
  2. Go to Marketing > Coupons and create a coupon: a signup fee % discount for 20%.
  3. Create a Variable Subscription product:
    • Under Attributes, add "Membership Tier" with "Regular|Premium" as values, and check Used for variations before saving.
    • Under Variations, create:
      • Regular: 80.00/month, with 5.00 signup fee
      • Premium: 100.00/month, with 5.00 signup fee
  4. As a shopper, purchase the "Regular" variation.
  5. Go to My Account > Subscriptions > View, and click "Upgrade or Downgrade". Upgrade to "Premium" and go to checkout.
  6. Add the signup fee % discount coupon.
  7. Verify that the "Order Summary Signup Fee" shows 25.00, but the discount amount is only 1.00 (20% of 5.00, the signup fee prior to upgrade costs).
  8. Test for different combinations of Prorate Recurring Payment and Prorate Signup Fee: no matter the combination, the discount amount should never be more than 1.00.
  9. Test using different coupon types:
    • signup fee coupon, e.g. 10.00: discount should always be 5.00 or less
    • recurring fee/recurring fee percent coupon: discount should be applied to upgrade cost excluding signup fee.
  10. Test a subscription downgrade.

Product impact

  • Added changelog entry (or does not apply)
  • Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
  • Added deprecated functions, hooks or classes to the spreadsheet

@annemirasol annemirasol force-pushed the add/726-support-signup-coupons-for-switches branch from 5fcdaa5 to ed0c575 Compare December 18, 2024 20:28
@annemirasol annemirasol force-pushed the add/726-support-signup-coupons-for-switches branch from ed0c575 to 912d4dc Compare December 18, 2024 21:07
@annemirasol annemirasol self-assigned this Dec 18, 2024
@annemirasol annemirasol force-pushed the add/726-support-signup-coupons-for-switches branch from 0095552 to 7e79332 Compare December 19, 2024 16:24
@annemirasol annemirasol marked this pull request as ready for review December 19, 2024 17:50
@annemirasol annemirasol requested review from a team, Mayisha and mattallan and removed request for a team December 19, 2024 17:50
@annemirasol
Copy link
Contributor Author

@mattallan Thank you again for the pointers. Added you as reviewer, for extra 👀

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

Successfully merging this pull request may close these issues.

Sign-up fee discount not applied when switching subscription
1 participant