latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Tina Plourde

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 3 topics - 1 through 3 (of 3 total)
Topic Count Last Reply
selling multiple ccaps

By:  Tina Plourde in: Community Forum

voices: 2
replies: 1

3 years, 7 months ago  Bruce

Question about CCAP – Paypal & the DB…

By:  Tina Plourde in: Community Forum

voices: 2
replies: 1

3 years, 11 months ago  Jason (Lead Developer)

Helpy with custom capabilities

By:  Tina Plourde in: Community Forum

voices: 2
replies: 2

4 years ago  Cristián Lávaque

Viewing 3 topics - 1 through 3 (of 3 total)

Topics I've Started


My Latest Replies (From Various Topics)

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday May 29th, 2013 at 4:45 pm #50872

ok, so I figured it out…when I echoed the variable, it turns out that only “1:XXXXX” being captured so thats a good thing…because I did a substr and just removed the 1st two characters to get the information that I wanted…

I probably should have done that from the start, but didn’t think of it…

Posted: Wednesday May 29th, 2013 at 3:38 pm #50867

Okay, so how would i apply that to my situation?

I’m not decoding anything as the information I need is in plain view…

This is the return URL that I am landing on after successful purchase –

http://mydomain.com/?cid=1%3Am748&s2p-v=13698XXXXXXXXXXXXXXXXXXXXXXXXX

the part I need (shown in bold) is here –

/?cid=1%3Am748&s2p-v=13698

The characters in italics ( 1%3A ) , I know the “1” is always going to be there because that’s the user level…but what about the percent sign, the number 3 and the letter A….what are those?

Posted: Tuesday May 28th, 2013 at 9:54 pm #50775

It could possibly be the way your theme is coded…Are you using a custom theme or one from the WordPress themes repository?

Posted: Sunday Jan 6th, 2013 at 1:51 am #36370

I got it working

if (current_user_can("access_s2member_ccap_" . $lowercnumber)){

Here is the complete working code (in case someone needs to do something like this

Declare Variables at top of template file —->

// declare variables //
	$cid = get_post_meta($post->ID, 'show_course_ss', true);
	$sql = "SELECT * FROM wp_wpcw_courses";
	$result = mysql_query($sql)or die(mysql_error());
	$row = mysql_fetch_array($result);
	$cprice    = $row['course_price'];
	$ctitle    = $row['course_title'];
	$cnumbr    = $row['course_number'];
	$postid = get_the_ID();
	$shows2ppinv = S2MEMBER_VALUE_FOR_PP_INV();
	$s2cuvfppon0 = S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0;
	$s2cuvfppon1 = S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1;
	$s2cuvfppos0 = S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0;
	$s2cuvfppos1 = S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1;
	// For some reason custom capabilities in s2member only work if they are lowercase - so this will take care of that lil bugger
	$lowercnumber = strtolower($cnumbr);
	

Use this code where you would like data to appear in template file –>

<?php if (current_user_can('access_s2member_level1')){
    
	echo "<h4>Course Details</h4>";
	
     if (current_user_can("access_s2member_ccap_" . $lowercnumber)){
	 

    //if a user is logged in and has purchased a course we show them the course //
	
	echo do_shortcode ('[wpcourse course="'.$cid.'" module_desc="false" show_title="false" show_desc="false"/]');
   
   } else {
	

	echo "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
 <input type='hidden' name='business' value='mypaypal@mydomain.com' />
 <input type='hidden' name='cmd' value='_xclick' />
 <!-- Instant Payment Notification & Return Page Details -->
 <input type='hidden' name='notify_url' value='http://example.com/?s2member_paypal_notify=1' />
 <input type='hidden' name='cancel_return' value='http://example.com/' />
 <input type='hidden' name='return' value='http://example.com/?s2member_paypal_return=1' />
 <input type='hidden' name='rm' value='2' />
 <!-- Configures Basic Checkout Fields -->
 <input type='hidden' name='lc' value='' />
 <input type='hidden' name='no_shipping' value='1' />
 <input type='hidden' name='no_note' value='1' />
 <input type='hidden' name='custom' value='example.com' />
 <input type='hidden' name='currency_code' value='USD' />
 <input type='hidden' name='page_style' value='paypal' />
 <input type='hidden' name='charset' value='utf-8' />
 <input type='hidden' name='item_name' value='".$ctitle."' />
 <input type='hidden' name='item_number' value='1:".$lowercnumber."' />
 
 <input type='hidden' name='invoice' value='". $shows2ppinv ."' />
 
 <input type='hidden' name='on0' value='". $s2cuvfppon0 ."' />
 <input type='hidden' name='os0' value='". $s2cuvfppos0 ."' />
 <!-- Identifies The Customers IP Address For Tracking -->
 <input type='hidden' name='on1' value='". $s2cuvfppon1 ."' />
 <input type='hidden' name='os1' value='". $s2cuvfppos1 ."' />
 <!-- Controls Modify Behavior At PayPal Checkout -->
 <!-- Customizes Prices, Payments & Billing Cycle -->
 <input type='hidden' name='amount' value='".$cprice."' />

 <input type='image' src='https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif' style='width:auto; height:auto; border:0;' alt='PayPal' />
</form>";
	
	}
    
 } else {

 //if a user is NOT logged in - they can neither purchase a course and they cannot view the course - regardless
	echo "<div class='cqd-notice rounded'>Please <a href='/register/'>Register</a> for an account or <a href='/login/'>Login</a> with an existing an account to <strong>enroll</strong> or <strong>purchase</strong> this course!</div>";
	
	
} ?>
Viewing 4 replies - 1 through 4 (of 4 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.