php snippet for cancel link

1 reply [Last post]
howtobox
Offline
Joined: 12/17/2009
Status: 
Answered

Hi, I was wondering if you could provide me with a php snippet that will allow me to put a cancel membership account on any page of my site.  I tried looking through the module to find the function that prints out the link in the user account, but have so far been unsuccessful.  I need it because I have created a customized user profile using panels and therefore, the cancel membership link can't be seen - so I need to manually add it somehow.  Thanks.

Leighton Whiting
Offline
Joined: 06/02/2009
Howtobox, With paypal, you

Howtobox,
With paypal, you can simply use this code:

  1. $paypal_email = 'yourpaypalemail@email.com';
  2. if (variable_get('ms_paypal_api_use_sandbox', FALSE)) {
  3. print l('Cancel Membership', "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=". urlencode($paypal_email), array('attributes' => array('target' => '_blank'))) .' ';
  4. }
  5. else {
  6. print l('Cancel Membership', "https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=". urlencode($paypal_email), array('attributes' => array('target' => '_blank'))) .' ';
  7. }

Just put in your paypal email that you are using to sell the subscriptions.

Sincerely,
Leighton Whiting

Twitter Feed