I can't figure this out, but it must be possible. I would like any logged in member to have their current role-status and how long is left to expiry shown somewhere on the front page, possibly in a block - much like their username is shown when they log in.

In ec_recurring_expiration we have the fields, txnid, start_time, vid, rid, expiry, status - so I can't simply grab userid + status + expiry straight off and display those results. I'm a little unsure on how to match which user made what upgrade so I can show their status to them in a block somewhere that they'll see all the time.

Any suggestions?

Comments

japo32’s picture

hi, have you found a solution for this? thanks!

japo32’s picture

please help guys. :(

Dabitch’s picture

I haven't found a solution for this. I have a few other problems with ecommerce, and I'm not sure sure where to ask for help on these issues.

Rhino’s picture

I'm also interested in this. If not here, where should we ask for information on this?

Rhino’s picture

This should be a feature request actually, since it is a very good idea.

japo32’s picture

i hope they can provide solutions for older versions of ecommerce. :( i hacked some of the portions of ecommerce for customization so i cant upgrade my installation. :(

japo32’s picture

hey guys here's an update! i created a block for showing the expiry date. it only shows 1 though. i added this to ec_recurring.module file:

function ec_recurring_block($op='list', $delta=0) {
  global $user;
  // listing of blocks, such as on the admin/block page
  if ($op == "list") {
    $block[0]["info"] = t("Subscription Expiry");
    return $block;
  } else if ($op == 'view') {
  
	$date = db_result(db_query("SELECT expiry FROM {ec_recurring_expiration} e, {ec_transaction} t WHERE e.txnid = t.txnid AND t.uid = %d", $user->uid));
	if($date)
	{
		$date = theme('recurring_date_expanded', $date);
		
		$block['content'] = "<p>You have until:</p><b>".$date."</b>";
		$block['subject'] = t('Subscription Expiry');
		return $block;
	}
  }
} // end ec_recurring_block

it works for my purposes so i hope you guys can use it :D

brmassa’s picture

Status: Active » Fixed

Guys,

i commited the code from Adrian (japo32).

regrads,

massa

Rhino’s picture

This is great, thanks

Rhino’s picture

Hmm.. I'm missing something obvious here, I've gotten the latest ec_reccuring from here and I can see that there is an "ec_recurring_block" in the code itself of this module. However, I can not find on the site where I turn this on. What am I missing? Should I be able to turn it on somewhere? Or should it just magically appear?

(note - I only replaced my old ec_reccuring with the latest ec_reccuringsince updating the entire Ecommerce module seemed to be overkill when only one file had an update for me. Might that be it?)

Rhino’s picture

I also get "user warning: Duplicate entry '1395-137173-1' for key 1 query: INSERT INTO ec_recurring_expiration (txnid, start_time, vid, rid, expiry, status) VALUES...(etc) in drupal/includes/database.mysql.inc on line 172" now that I am using the new ec_reccuring.module

Help?

Dabitch’s picture

Do a proper upgrade with the entire ecommerce package and that glitch will go away.

However, I too can't find this mystery block. Where is it? Do I have to turn it on? I can not find it in "Blocks" and it's not automatically on. What am I missing?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.