Upgrade menu shows inappropriate option

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
7 years 8 months ago #101923 by hide10
Hello,

I'm reporting this because I think this might be a bug regarding "Upgrade Membership" function.

Outline of the issue:

There are 3 plans, for example:
- Basic: Free for lifetime
- Regular: $5 for 1 month
- Pro: $50 for 1 year

Upgrade options are set as below:
- Basic can upgrade to "Regular" or "Pro"
- Regular can upgrade to "Pro"

How to reproduce the issue:
- First, a user signs up for a Basic plan.
- Next, he upgrades from "Basic" to "Pro".
- His subscription history shows correctly as "Basic is expired, and Pro is active" (both on frontend and backend).
- However, when he accessed the "Upgrade" menu, it says:
"Upgrade from subscription plan Basic to subscription plan Regular. Price $5."

This is very confusing and I think this is a bug.
His Basic plan is already expired and now has a "Pro" plan.
Therefore, no upgrade option should be shown.

Will you please check on your end?
(v2.9.0)

Thanks,

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
7 years 8 months ago #102126 by hide10
Replied by hide10 on topic Upgrade menu shows inappropriate option
No response yet?

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102135 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Upgrade menu shows inappropriate option
Actually, at the moment, there is no way for the system to know the relation ship between basic , standard and pro, so I don't know how to handle this requirement

Currently, we still allow upgrading if the original plan is free (even it is expired). I will try to think more about this case to see whether we can find a solution. For now, you can do a quick modification to the code to prevent upgrade when the plan is already expired:

1. Open the file components/com_osmembership/helper/subscription.php

2. Find the method getUpgradeRules

3. Find this line of code:
Code:
$query->select('DISTINCT plan_id') ->from('#__osmembership_subscribers') ->where('user_id = ' . $userId) ->where('(published = 1 OR (published = 2 AND amount = 0))');
3. Change it to:
Code:
$query->select('DISTINCT plan_id') ->from('#__osmembership_subscribers') ->where('user_id = ' . $userId) ->where('published = 1');

It should solve your issue/concern for now

Tuan

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
7 years 8 months ago - 7 years 8 months ago #102239 by hide10
Replied by hide10 on topic Upgrade menu shows inappropriate option
Hello Tuan,

Thanks for your reply about tentative solution.
I've confirmed it works as expected :)

Hope this fix will be integrated into next update.
Thanks!
Last edit: 7 years 8 months ago by hide10.

Please Log in or Create an account to join the conversation.