Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-23T06:03:16-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16460 2011-12-23T06:03:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16460&p=58615#p58615 <![CDATA[Re: Register by buying a product]]> $_GET array, and the header function was missing 'Location: ' before the URL.
http://php.net/manual/en/reserved.variables.get.php
http://www.php.net/manual/en/function.header.php

About the syntax error, it's probably a limitation with those PHP shortcodes, not sure.

Here's what I'd try, since you'll be doing a redirection instead of showing one content or another.

Create the dir/file /wp-content/mu-plugins/s2hacks.php and add this:

Code:
<?php 

if 
(isset($_GET['s2p-coupon'] && $_GET['s2p-coupon'] == 'free')) { 
    header
('Location: http://gplusdecoded.com/wp-login.php?action=register');
}

?>
Don't leave any spaces or lines outside the PHP tags.

Let me know if that works. I hope it helps. :)

Statistics: Posted by Cristián Lávaque — December 23rd, 2011, 6:03 am


]]>
2011-12-22T15:24:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16460&p=58534#p58534 <![CDATA[Re: Register by buying a product]]> PHP Execution plugin), but it might have trouble separating the PHP IF block into separate [php][/php] blocks.

Can you try giving the other PHP plugin a try and see if that works?

Statistics: Posted by Raam Dev — December 22nd, 2011, 3:24 pm


]]>
2011-12-21T19:56:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16460&p=58447#p58447 <![CDATA[Re: Register by buying a product]]>
Here's what I've done:
I've installed the Allow PHP in Posts and Pages plugin, and then put this in my page:

Code:
[php] if (isset($_GET['?s2p-coupon='] && $_GET['?s2p-coupon='] == 'free')) { header( 'http://gplusdecoded.com/wp-login.php?action=register' ) ;[/php]

[
php] } else { [/php]
content of my paid form
[php] } [/php] 


When I go to: http://gplusdecoded.com/products-2/the- ... oupon=FREE I get:

Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ‘,’ or ‘)’ in /homepages/23/d393606834/htdocs/gplusdecoded2/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(83) : eval()’d code on line 1

Parse error: syntax error, unexpected ‘}’ in /homepages/23/d393606834/htdocs/gplusdecoded2/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(83) : eval()’d code on line 1

Statistics: Posted by yifatcohen — December 21st, 2011, 7:56 pm


]]>
2011-12-20T21:13:03-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16460&p=58336#p58336 <![CDATA[Re: Register by buying a product]]>
I don't understand what you're trying to control. Can you give me an example post that sends people to the register page? What page did you select for the Membership Options Page (WP Admin -> s2Member -> General Options -> Membership Options Page)?

Normally when a non-logged in user tries to access a protected page, s2Member will redirect them to the Membership Options Page. That's the page where they can purchase access. So, it sounds like your 'products-2' page should be the one selected as the Membership Options Page.

Regarding the free coupon: You'll need to use a free registration form and hide it from anyone who doesn't have the free coupon code. Please see this example: viewtopic.php?f=4&t=16176&p=54466#p54503

Statistics: Posted by Raam Dev — December 20th, 2011, 9:13 pm


]]>
2011-12-20T17:25:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16460&p=58315#p58315 <![CDATA[Register by buying a product]]>
I'd like my posts to send them to the product page (http://gplusdecoded.com/products-2), rather than http://gplusdecoded.com/wp-login.php?action=register

Where do I control that?

Also - how do I use a coupon that basically gives the product away for free (right now it charges $0.01) even if the coupon value is greater than the product value.

Statistics: Posted by yifatcohen — December 20th, 2011, 5:25 pm


]]>