PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Generate HTML for pro-forms

s2Member Plugin. A Membership plugin for WordPress®.

Generate HTML for pro-forms

Postby ifanatics » June 26th, 2011, 9:13 am

Greetings,

I need to try to generate HTML code (instead of shortcode) for pasting pro-forms into a page. This is easy to do with buttons because it offers you both the shortcode and the HTML code. How can I get the equivalent for pro-forms?


Thanks.
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » June 26th, 2011, 6:51 pm

You could use the shortcode, view the page and copy the HTML there. Haven't tried that with pro-forms, but you could see if it works for you.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby ifanatics » June 26th, 2011, 9:21 pm

Thanks for the suggestion, although that is not quite working, as it creates an over-complicated situation of trying to figure out what to copy and paste in order to create a form.

I like the shortcode function, but in order for my affiliate software to work properly, I need to render a specific field in HTML. It is not working properly when trying to use it in the shortcode.

Here's what I'm doing currently (with the shortcode):
custom="mysite.com|<?php echo $_COOKIE['ap_id']; ?>"

Here's what I need to do in order for the affiliate software to work properly:
<input type="hidden" name="custom" value="mysite.com|<?php echo $_COOKIE['ap_id']; ?>" />

Yes, I'm using the PHP Exectution Plugin.

For whatever reason, this will not work with the shortcode. It needs to be in regular HTML to work... proven by the fact that it works with paypal buttons (when using the long-code), but I need to get this to work with pro-forms.

Any solutions to get this working properly would be greatly appreciated.
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » June 26th, 2011, 10:22 pm

OK, got it that it works with the button but not the form. If you <?php echo $_COOKIE['ap_id']; ?> in the page, outside of the shortcode, does it echo what it should? Have you tried the Notification API to a custom script to see how the $_COOKIE['ap_id'] string cames through?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby ifanatics » June 27th, 2011, 4:04 am

Doesn't look like that's going to do the trick, as the string:
<input type="hidden" name="custom" value="mysite.com|<?php echo $_COOKIE['ap_id']; ?>" /> is meant to REPLACE:
<input type="hidden" name="custom" value="www.example.com" />

Therefore, it seems to me that it needs to happen before the PayPal button is pushed?

The instructions explaining this integration from the Affiliate Software can be found here: http://www.tipsandtricks-hq.com/wordpre ... mment-1545

Thanks.
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » June 27th, 2011, 3:44 pm

OK, you could try using a custom template for the form, maybe you can add your hidden input there. Copy template for your form from the /wp-content/plugins/s2member-pro/includes/templates/forms/ directory and paste it in your theme's directory. You can name it whatever you want, make it .php instead of .html even. Edit the template the way you need it and then tell the shortcode to use that file as the template for the form using the template attribute. WP Admin -> s2Member -> PayPal Pro-Forms -> Shortcode Attributes (Explained) -> template
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby Jason Caldwell » June 27th, 2011, 11:48 pm

Thanks for the excellent question.
~ and thanks for bringing this to my attention Cristián.

Here's what I'm doing currently (with the shortcode):
custom="mysite.com|<?php echo $_COOKIE['ap_id']; ?>"

This is the correct way to handle this with s2Member Pro Forms. No, there is no way to render an s2Member Pro Form with raw HTML, at least not like you can with a PayPal Button. A Pro Form is very dynamic, and requires much more than just a code snippet to function properly, thus, a code snippet is not provided for Pro Forms; you should always use the Shortcode format for Pro Forms.

Based on the instructions provided here, I see no reason why the Shortcode would not work. I would suggest going back over your integration of the affiliate software, and just double check that you've got all the Replacement Codes entered properly in your Payment Notification URL. Also, be sure that $_COOKIE['ap_id'] actually has a value. If that variable is empty, tracking will not work as intended.

Correct solution ( use Shortcode )
Code: Select all
custom="mysite.com|<?php echo $_COOKIE['ap_id']; ?>"
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby ifanatics » June 28th, 2011, 8:56 am

Hi Jason,

Thanks for the reply. I have confirmed that everything is correct, in the shortcode and in the payment notification url.

The value does get passed through, as I can see the affiliates name on the paypal order details. It reads: "custom: name". But the referring affiliate is not credited with the sale. When asking the providers of the affiliate software, they said it was not compatible with s2member pro forms... which seems strange to me also as it all looks like it *should* work.

I'm beating my head against the wall on this one. I had no idea that this was going to be a problem before deciding to use this affiliate software, but I spent a lot of time setting it up and I do like the interface. Would really like to get it working if you have any further ideas.

Thanks again.
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Jason Caldwell » June 29th, 2011, 5:33 pm

Cristián, can you please send an email to the developers of this plugin for us? Maybe invite them to join this thread in an effort to resolve the problem here. It sounds to me like everything is configured properly, and if the affiliate program integration is implemented through s2Member's Payment Notification URL, the %%cv1%% Replacement Code should be available there with both Button and/or Pro Form integration.

** If the developer needs a copy of s2Member Pro to complete his tests, we'll be happy to offer that.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby ifanatics » June 29th, 2011, 6:43 pm

Awesome!

Thanks for the follow up on this. I look forward to finding a solution.
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » June 30th, 2011, 1:41 am

Sent the email just now.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby Jason Caldwell » June 30th, 2011, 3:04 pm

Thank you!
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby ifanatics » July 3rd, 2011, 12:52 am

Hey Guys,

Just a follow-up... Any progress on this?


Thanks!
User avatar
ifanatics
Registered User
Registered User
 
Posts: 11
Joined: June 21, 2011

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » July 3rd, 2011, 1:35 am

We're in communication with the developer by email. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby Jason Caldwell » July 3rd, 2011, 1:17 pm

The developer has indicated that he thinks the problem is with this section of code:
Code: Select all
custom="mysite.com|<?php echo $_COOKIE['ap_id']; ?>"

He believes the PHP tag here is NOT being processed successfully. Do you have a PHP execution plugin installed? If so, please run a quick test inside one of your Pages/Posts to be sure it's working as expected. Try testing a PHP tag like this please.
Code: Select all
<?php echo 'Hello world.'; ?>

PHP Execution Plugin ( required for PHP tags ):
http://wordpress.org/extend/plugins/php ... on-plugin/
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby Jason Caldwell » July 3rd, 2011, 2:07 pm

If all else fails. Please remove the PHP tag from your Shortcode, and instead follow these instructions.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_action 
("ws_plugin__s2member_before_sc_paypal_button_after_shortcode_atts", "wp_aff_s2member_integration");
add_action ("ws_plugin__s2member_pro_before_sc_paypal_form_after_shortcode_atts", "wp_aff_s2member_integration");
function wp_aff_s2member_integration ($vars = array ())
    {
        $cookie_value = esc_html ($_COOKIE["ap_id"]);
        $vars["__refs"]["attr"]["custom"] .= "|" . $cookie_value;
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » July 7th, 2011, 1:57 am

The developer of the Affiliate plugin just let us know that he release a new update that integrates with s2Member much better and simpler!

Thank you guys for all the pointers and help. I have now released an updated version of the affiliate plugin and integrating this version with the s2Member is super easy. The customer essentially have to activate these two plugins and check a few checkboxes and thats it. Here is the updated integrated instruction:

http://www.tipsandtricks-hq.com/wordpre ... ftware-368


:)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Generate HTML for pro-forms

Postby Jason Caldwell » July 8th, 2011, 4:10 pm

Nice work Cristián!
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Generate HTML for pro-forms

Postby Cristián Lávaque » July 8th, 2011, 8:43 pm

Nice work Jason! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron