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.

Issues with Coupons in Custom Pro-Form

Home Forums Community Forum Issues with Coupons in Custom Pro-Form

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 4 years, 3 months ago.

Topic Author Topic
Posted: Tuesday Sep 11th, 2012 at 10:18 pm #24956

I used sample code from the forums for a dropdown style pro-form that posts back to itself and fills in the details of the proform shortcode. That part works great. The issue is when I turn on coupons. If you try to put a coupon code in and click the Apply Coupon button it just goes back to the page as though the original dropdown was never selected. Please help.

<?php
$mlevels = array(
	1 => array('ra' => '19.95',  'desc' => 'Algebra 1 $19.95 USD Monthly Membership', 'ccap' => 'algebra1'),
	2 => array('ra' => '19.95',  'desc' => 'Algebra 2 $19.95 USD Monthly Membership', 'ccap' => 'algebra2'),
	3 => array('ra' => '19.95',  'desc' => 'Geometry $19.95 USD Monthly Membership', 'ccap' => 'geometry'),
	4 => array('ra' => '199.95', 'desc' => 'Algebra 1 $199.95 USD Annual Membership', 'ccap' => 'algebra1'),
	5 => array('ra' => '199.95', 'desc' => 'Algebra 2 $199.95 USD Annual Membership', 'ccap' => 'algebra2'),
	6 => array('ra' => '199.95', 'desc' => 'Geometry $199.95 USD Annual Membership', 'ccap' => 'geometry'),
);

echo '<form action="" method="post" name="proformcart"> <select name="mlevel"> <option></option>';
foreach ($mlevels as $k => $v)
	echo '<option value="' . $k . '">' . $v['desc'] . '</option>';
echo '</select> <input type="submit" name="submit" value="Select" /> </form>';

if (isset($_POST['mlevel'])) {
	$mlevel = (int) $_POST['mlevel'];
	echo '[s2Member-Pro-PayPal-Form level="1" ccaps="' . $mlevels[$mlevel]['ccap'] . '" desc="' . $mlevels[$mlevel]['desc'] . '" ps="MyMathGeek" lc="" cc="USD" dg="0" ns="1" custom="www.mymathgeek.com" ta="0" tp="0" tt="D" ra="' . $mlevels[$mlevel]['ra'] . '" rp="1" rt="Y" rr="1" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="1" default_country_code="" captcha="1" /]';
}
?>

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Wednesday Sep 12th, 2012 at 8:17 am #24994

Hi Stephen.

That may be because when the coupon is submitted, [hilite mono]$_POST['mlevel'][/hilite] is not set. You’ll probably need to use the session or a cookie to store the selected [hilite mono]mlevel[/hilite], and check that instead of [hilite mono]$_POST[/hilite].

I hope that helps. :)

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.