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: Andrew Scofield

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


Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Variables in shortcode

By:  Andrew Scofield in: Community Forum

voices: 2
replies: 4

4 years, 5 months ago  Raam Dev

Viewing topic 1 (of 1 total)

Topics I've Started

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Variables in shortcode

By:  Andrew Scofield in: Community Forum

voices: 2
replies: 4

4 years, 5 months ago  Raam Dev

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Friday Aug 3rd, 2012 at 8:41 pm #21146

The code is fairly extensive, but hopefully I can clarify.

I am building my shortcode dynamically, in php it looks like this:

<?php
$shortcode = '[s2Member-Pro-PayPal-Form level="1" ccaps="'.$ccaps.'" desc="'.$descPretty.'" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="localhost" ta="0" tp="0" tt="D" ra="'.$totalPrice.'" rp="1" rt="L" rr="BN" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" template="checkout.php" /]';
?>

As you can see I have some variables in my shortcode: $ccaps, $descPretty and $totalPrice . These variables are set the first time the checkout page is loaded based on a from on a previous page. If there are any errors in the s2member pro form processing the page is reloaded and the form is re-displayed but my variables are not set because the $_POST data from the previous page is no longer set. This causes errors, for example the desc=”” attr is empty because my variables are empty.

So to try and clarify, if there are errors when the pro form is processed and the checkout page is re-loaded, my variables are left empty.

How can I re-set my variables? Can I do it from the “s2member_pro_paypal_checkout” array somehow when the form is processed?

Does that help clarify?

Thanks,

David

Posted: Friday Aug 3rd, 2012 at 12:35 am #21067

I bypassed the POST variables for the checkout form precessing, which allowed me to overcome the errors I was experiencing.

Now there is a secondary problem, if there is an error while processing the form the variables for the shortcode are not set. Can I re-set the variables on the page load when the checkout for is processing. Like pulling them from the “s2member_pro_paypal_checkout” array somehow? When looking at that array the “attr” is encrypted.

Viewing 2 replies - 1 through 2 (of 2 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.