Invalid Subscription code error

  • Dhileep
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118166 by Dhileep
Invalid Subscription code error was created by Dhileep
Hello Support,

I'm your OLD customer. Purchased Membership Pro a couple of years ago. Currently, I am using your 2.0.3 version. This is working fine until the last day. All of a sudden our customers started getting the following error message,

"Invalid Subscription Code"

I see someone has reported the same issue in your forum and you replied this is solved in your 2.04+ version. Unfortunately, I forgot my account details in your website since we purchased this a long ago. Can you please share the code that solves this issue? So, I can add the fix to my site.

Best Regards,
Dhileep

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

More
6 years 9 months ago #118167 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invalid Subscription code error
Hello

Please submit a support ticket:

1. Sending us the email you used to purchase the product or PayPal Transaction ID of the purchase so that we can verify your order before providing support

2. Send us super admin account of your site. Although your subscription was expired long time ago, I will try to check and get it sorted for you

Regards,

Tuan

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

  • Dhileep
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118170 by Dhileep
Replied by Dhileep on topic Invalid Subscription code error
I'm able to get into my account. But, where can I find the order ID. Kindly check my attached screenshot. This is what all I see inside my account page.

My Account Name is "Suryak"

But, sorry. I cannot share the site admin details. I'm a Joomla! developer and I can apply the solution if you can guide me. I'm not expecting an upgrade or complete package. Just need the solution for the BUG in the version I have installed.
Attachments:

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

More
6 years 9 months ago #118171 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invalid Subscription code error
Hello

I don't keep that very old version of the extension here, so without accessing to your site, I don't know how to check this error

Maybe you can send me:

1. URL of the page (which causes that error)


2. Attach the file components/com_osmembership/view/complete/html.php

3. Attach the file components/com_osmembership/model/register.php

I will try to look at it and hopefully, find out what's wrong with that old version

Tuan

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

  • Dhileep
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118205 by Dhileep
Replied by Dhileep on topic Invalid Subscription code error
Sorry for the late response. Here are all the files you asked.

File Attachment:

File Name: register_html.zip
File Size:5 KB

File Attachment:

File Name: register_html.zip
File Size:5 KB
Attachments:

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

More
6 years 9 months ago #118206 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invalid Subscription code error
Hi

In the file register.php, change
Code:
JFactory::getSession()->set('mp_subscription_code', $row->subscription_code);

To :
Code:
JFactory::getSession()->set('mp_subscription_id', $row->id);

In the file html.php, change
Code:
$subscriptionCode = JFactory::getSession()->get('mp_subscription_code'); // Get subscriber information $query->select('*') ->from('#__osmembership_subscribers') ->where('subscription_code = ' . $db->quote($subscriptionCode)); $db->setQuery($query); $rowSubscriber = $db->loadObject();

To:
Code:
$subscriptionId = JFactory::getSession()->get('mp_subscription_id'); // Get subscriber information $query->select('*') ->from('#__osmembership_subscribers') ->where('id = ' . (int) $subscriptionId); $db->setQuery($query); $rowSubscriber = $db->loadObject();

After that, the issue should be sorted

Tuan

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

  • Dhileep
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118207 by Dhileep
Replied by Dhileep on topic Invalid Subscription code error
Hi,
First of all thank you very much for your quick response. I changed the code, but still getting the same error. Shall I send the membership_pro package to your mail id? If it is ok please send your mail id. I will send the package.

Thanks in advance.

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

More
6 years 9 months ago #118208 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invalid Subscription code error
Could you please try to debug yourself? In the file html.php, after the code you modified above, add this command:
Code:
echo $db->getQuery();die();

We need to make sure the ID of the subscription record is stored during the sign up process and can be get from subscription complete page (If you know Joomla programming, you will know that it's stored and retrived using session)

Also, please make sure you run a new test before making the modification above

Tuan

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

  • Dhileep
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118215 by Dhileep
Replied by Dhileep on topic Invalid Subscription code error
Hi,
After adding the code I am getting a query like this "SELECT * FROM #__osmembership_subscribers WHERE id = 847"

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

More
6 years 9 months ago #118216 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invalid Subscription code error
That look correct to me. Maybe you can check to see whether there is any subscription record with ID = 847 there?

Also, check Membership Pro -> Configuration to see whether there is a config option called Subscription Renewal Behavior, if there is, make sure set it to Create New Subscription instead of Update Subscription

Tuan

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

Moderators: Tuan Pham Ngoc