Hello, Everyone. Brand new user here.
I’m working on a WordPress-based site which is based on the S2 Member Pro, BuddyPress and GeoDirectory plugins. I’ve been working with Jason of S2 fame, however, I think I might have surpassed his PHP support. That being said, I’m hoping I might get some insight from you all.
My site has several categories and I’m planning to offer four types of membership levels via CCAPs in each category. I’ve created an S2-based page which allows for multiple forms. I’m trying to pass along a category attribute which the page will “remember” when a member chooses their membership level. Both the category and membership forms are taking place on the same page. Basically, the member will choose which category they wish to post their directory listing to and hit “submit.” Upon submission, the form will keep their category level and the member will then choose which membership level to join. So, a member might choose “category1” and then choose “category1_enhanced” for an enhanced listing within the Category #1 section. Then, when the member pays they are redirected back to their BuddyPress profile page where there will be a dynamic link to allow the member to submit a “category1_enhanced” level listing. This is all working as should be expected, however, except I cannot get the dynamic membership level to pass along to the sign up form.
Here’s my code:
<?php
session_start();
$category = array();
if(isset($_POST['buttons'])) {
foreach($_POST as $key => $value) {
$category[$key][$value] = "checked";
}
} elseif(isset($_SESSION['category'])) {
$category = $_SESSION['category'];
}
echo '<form method="post" action='.$_SERVER['php_self'].'>
';
echo '<input type="radio" name="buttons" value ="Brewery" '.$category['buttons'][Brewery].' >Brewery<br>
';
echo '<input type="radio" name="buttons" value ="Cidery" '.$category['buttons'][Cidery].' >Cidery<br>
';
echo '<input type="radio" name="buttons" value ="Winery" '.$category['buttons'][Winery].' >Winery<br><br>
';
echo '<input type="submit" value="click here">
';
echo '</form><br><br>
';
$_SESSION['category'] = $category;
?>
[s2MOP]
<p style="border-radius: .5em; background: #FFD599; padding: .5em;">Sorry. Request denied. You were redirected to this page because you attempted to access content that is protected; i.e., it requires paid access. Please <a href="/wp-login.php">log in</a> or make a purchase below.</p>
[/s2MOP]
Please fill out the following form to add your free/basic, enhanced or enhanced/featured listing with event submissions below. <a href="/pricing/">Need more details on the various options?</a>
[s2Member-Pro-Stripe-Form]
[s2Member-Pro-Stripe-Form register="1" level="0" ccaps="<?php echo esc_attr($category); ?>>_free" desc="Basic <?php echo esc_attr($category); ?> - Free!" custom="www.xxxxx.org" tp="0" tt="D" captcha="clean" /]
[s2Member-Pro-Stripe-Form level="1" ccaps="<?php echo esc_attr($category); ?>_enhanced" desc="Enhanced <?php echo esc_attr($category); ?> - $9.99 + tax monthly" cc="USD" custom="www.xxxxx.org" ta="9.99" tp="1" tt="M" ra="9.99" rp="1" rt="M" rr="1" coupon="" accept_coupons="0" default_country_code="US" captcha="clean" /]
[s2Member-Pro-Stripe-Form level="2" ccaps="<?php echo esc_attr($category); ?>_events_enhanced" desc="Enhanced <?php echo esc_attr($category); ?> with Calendar Submissions - $19.99 + tax monthly" cc="USD" custom="www.xxxxx.org" ta="19.99" tp="1" tt="M" ra="19.99" rp="1" rt="M" rr="1" coupon="" accept_coupons="0" default_country_code="US" captcha="clean" /]
[s2Member-Pro-Stripe-Form level="3" ccaps="<?php echo esc_attr($category); ?>_events_featured" desc="Featured <?php echo esc_attr($category); ?> with Calendar Submissions - $39.99 + tax monthly" cc="USD" custom="www.xxxxx.org" ta="39.99" tp="1" tt="M" ra="39.99" rp="1" rt="M" rr="1" coupon="" accept_coupons="0" default_country_code="US" captcha="clean" /]
[/s2Member-Pro-Stripe-Form]
If anyone has any insight they might share, I’d very much appreciate it.
Thanks much, in advance.
Regards,
Kory