Display Expiration Date in CB Subscription Module

9 years 2 months ago #125723 by griffweb
Is there a way to modify the data in the CB Subscriptions module to not only show the user their plan but also the expiration date? I would like that very much.. :) It would help them realize that they only have x number of days before it expires.

I know there are all sorts of text boxes for intro and footer text, etc.. It would be cool if we could use some switches like "Your Subscription will Expire on %D"

Just my thoughts, please advise..

Thanks for a great product!!

Mike
9 years 2 months ago #125727 by nant
griffweb wrote:

Is there a way to modify the data in the CB Subscriptions module to not only show the user their plan but also the expiration date? I would like that very much.. :) It would help them realize that they only have x number of days before it expires.

I know there are all sorts of text boxes for intro and footer text, etc.. It would be cool if we could use some switches like "Your Subscription will Expire on %D"

Just my thoughts, please advise..

Thanks for a great product!!

Mike


Nothing like this at the moment, but its a great idea. Marking it for consideration #1563
7 years 2 months ago #192787 by arkadialove
It's been 2 years since this was marked for consideration? Any progress? I need to display the expiration date of the users on the welcome page when they log in. CB Subscriptions Module could really use this feature...otherwise could you point me in the right direction to get this done in the php files?

Thanks!
7 years 2 months ago #192794 by arkadialove
Okay, figured it out. In case anyone else wants to know...you can use an sql query and get the expiration date hard coded in the relevant file. I edited the mod_cbsubscriptions.view.php file...(I presume it's safe to do this if you don't intend on upgrading the module?) - hopefully we won't need to do this in future! Expiration date seems like one of the most basic features any subscription module should have.

Here is the code:

<div id="expiry_notice">
<?php

$db = JFactory::getDbo();
$query = $db->getQuery( true );

$query = "SELECT expiry_date FROM #__cbsubs_subscriptions WHERE user_id = '" . $_CB_framework->myId() . "' AND status = 'A'";

$db->setQuery($query);

$result = $db->loadResult();

$dt = strtotime($result);

echo "Membership Valid Until: <br />" . date("F j, Y", $dt);

?>
</div><!--#expiry_notice-->
7 years 2 months ago #193207 by Aly
Perhaps I'm confused by your request? I've always been able to see my expiration date on the Subscription tab on my profile page. Are you posting it also - elsewhere with your solution?
7 years 2 months ago - 7 years 2 months ago #193209 by arkadialove
Hi,

Yes,I wanted to post the expiry date on another page other than the profile page. The CB Subscription Module doesn't include expiry date. Just subscription type and some other options. So the above code can be used to display expiry date in other areas you may want to display the expiration date. I have a welcome page that members go to when they log in where they can see announcements etc. and I wanted their subscription info including expiry to be displayed there as well. :)
Moderators: beatnantkrileon
Time to create page: 0.394 seconds
Facebook Twitter Google LinkedIn