Page 1 of 1

Template shortcode not working

PostPosted: July 17th, 2011, 2:07 pm
by scottgould
Hi Guys

I am trying to use the Template shortcode option in my pro forms.

Currently it looks like this:

Code: Select all
[s2Member-Pro-PayPal-Form level="1" ccaps="+exeter2011,attendee" desc="<strong>Full registration for the conference is £280 ex. VAT.</strong>" ps="paypal" lc="" cc="GBP" dg="0" ns="1" custom="wearelikeminds.com|exeter2011|23" ta="0" tp="0" tt="Y" ra="280" rp="1" rt="Y" rr="BN" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" success="https://wearelikeminds.com/registration/exeter-2011/customise" template="checkout.php" /]


However, the checkout.php page is not being used.

I'm not sure what I might be doing wrong here

Thanks in advance for your help - I am very grateful for all you guys do,

Scott

Re: Template shortcode not working

PostPosted: July 17th, 2011, 3:52 pm
by Cristián Lávaque
Hi Scott. :)

Where did you put checkout.php? It has to be in /wp-content/ or your theme's directory (i.e. http://wearelikeminds.com/wp-content/themes/likeminds/).

Re: Template shortcode not working

PostPosted: July 17th, 2011, 4:04 pm
by scottgould
Hi Cristián,

It's in the theme folder - I'll try putting it in /wp-content/

Scott

Re: Template shortcode not working

PostPosted: July 17th, 2011, 8:36 pm
by Cristián Lávaque
Cool. Let me know if that works better for you.

If not, please zip checkout.php and send us the file or a link to it by email, so we can take a look at the code.

Re: Template shortcode not working

PostPosted: July 18th, 2011, 2:59 am
by scottgould
Boom!

Yes it works by putting it in /wp-content/

Two more questions quickly, if you know how this will help:

1. How do I change the text in %%coupon_response%%, or other shortcodes? (i.e., when it says "Sales Tax", I need to change that to just "Tax")

2. How do I change the PayPal button image to be just a plain button? (The whole reason why I'm using pro forms is to appear like I'm not using PayPal you see)

Thanks,

Scott

Re: Template shortcode not working

PostPosted: July 18th, 2011, 11:37 pm
by Cristián Lávaque
Great! Glad it worked there. :)

1. How do I change the text in %%coupon_response%%, or other shortcodes? (i.e., when it says "Sales Tax", I need to change that to just "Tax")

You could try using str_replace or strtr for that.
http://php.net/str_replace
http://php.net/strtr

2. How do I change the PayPal button image to be just a plain button? (The whole reason why I'm using pro forms is to appear like I'm not using PayPal you see)

For the PayPal option it has to be the PayPal button, it seems to be a PayPal policy. When choosing one of the other options (Visa, Matercard, etc) the button changes to a normal HTML one, which I believe you can edit with CSS.

Re: Template shortcode not working

PostPosted: July 19th, 2011, 5:39 am
by scottgould
Hi Cristián

Thanks - but this won't work as %%coupon_response%% is not a PHP Variable - so when it put it in PHP, the page errors!

Any ideas?

Scott

Re: Template shortcode not working

PostPosted: July 19th, 2011, 11:17 pm
by Cristián Lávaque
Ah, I see. Hmm.... Well, you could try replacing that string with JavaScript... or find where s2Member replaces that code with the string and then you edit it there using a hook.

Re: Template shortcode not working

PostPosted: July 21st, 2011, 5:41 pm
by Jason Caldwell
Thanks for the heads-up on this thread.

I did just confirm that s2Member Pro v110710+ will correctly find a custom template file inside your active theme directory. It has to be inside your active theme directory, like this:
/wp-content/themes/twentyeleven/checkout.php
Please let me know if you continue to have trouble with this.

The /wp-content/ directory also works, and if present, will override the one inside the active theme directory: /wp-content/checkout.php.

Re: Template shortcode not working

PostPosted: July 21st, 2011, 5:47 pm
by Jason Caldwell
scottgould wrote:Thanks - but this won't work as %%coupon_response%% is not a PHP Variable - so when it put it in PHP, the page errors! Any ideas?
Sorry, there is no way to modify this value yet, not without modifying the source code for s2Member Pro. I'll see what we can do about this in a future release. Until then, you can search the s2Member Pro file: /s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php for public static function paypal_apply_coupon

See source file: viewtopic.php?f=40&t=13268&src_doc_v=110710#src_doc_line_401