Display expiry date

Permalink Browser Info Environment
Hello people :)

Has anybody made it possible to display the expiry date of a membership in the users profile?

This would be great :)

Type: Discussion
Status: New
Cahueya
View Replies:
jshannon replied on at Permalink Reply
jshannon
Hi.

Try this:

Loader::model('txns', 'lerteco_membership');
        $lastTxnsList = new LMemTxnsList();
   $lastTxnsList->filter('uID', $uID);
   $lastTxnsList->filter('productID', $productID);
   $lastTxnsList->sortByDate('DESC');
   $lastTxns = $lastTxnsList->get(1);
   if ($lastTxns && count($lastTxns)) {
      $lastTxn = $lastTxns[0];
      if ($lastTxn->expirationDate) {
         echo "Expires " . $lastTxn->expirationDate;
      } else {
         echo "Doesn't expire";
      }
   } else {
      echo "No membership";


$uID is the userID, and $productID is the product ID (which you can get if you choose a product in the dashboard and then look at the URL).

Obviously, you're going to need some familiarity with C5 and PHP here. It'd be easiest to put this into a single page. Block would be "most c5". The most hacky, but should work, would be a PHP block.

Please advise how this works out for you...

James

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.