Page 1 of 1

Different levels for coupon users and non coupon users

PostPosted: June 21st, 2011, 1:28 pm
by rainbowsurfer
I'd like people who buy via a coupon to become members at one level and people who buy without a coupon to go in at a lower level. Is that possible?

Thanks

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 12:19 am
by Cristián Lávaque
No, not in the current version.

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 2:09 am
by Jason Caldwell
Yea, sorry. This is not possible yet.

Thanks for bringing this to my attention Cristián. I'll see what we can do about this in a future release.

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 3:36 am
by rainbowsurfer
As a work round is there a way to make the coupon code a required field. That way if the person doesn't have the code they would have to fill out a different form which gives a different member level.

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 3:41 am
by Cristián Lávaque
Well, you could add a custom coupon field at the top of the form, but not the standard one. Make it a separate form before the pro-form, that will submit to another page that checks if the coupon is right or not. If not, it'll redirect the person back to the page he came from. If it is the right coupon, though, it'll stay in that new page and display the form for the other membership. Would something like that work?

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 3:43 am
by Jason Caldwell
Are you running Pro Forms with PayPal or Authorize.Net?
Are you selling Specific Post/Page Access, or Membership Access?

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 3:58 am
by rainbowsurfer
Hi Cristian not sure how to do what you suggest but that might work if you have any suggestions on how to do it I'll give it a try.

Hi Jason I'm running Pro Forms with PayPal for membership access.

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 4:15 am
by Jason Caldwell
One possible way to make the Coupon Code required, is this.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_action 
("wp_head", "my_function");
function my_function ()
    {
        echo '<script type="text/javascript">';
        echo "jQuery(document).ready(function(){ jQuery('input.s2member-pro-paypal-coupon').attr('aria-required', 'true'); });";
        echo '</script>';
    }
?>

Re: Different levels for coupon users and non coupon users

PostPosted: June 22nd, 2011, 6:28 am
by rainbowsurfer
That's brilliant Jason thanks for that it works. One thing, is there a way to say on the Pro Form that it is a required field with either a * beside the coupon field or to change the wording where it says please enter here.
Many thanks again

Re: Different levels for coupon users and non coupon users

PostPosted: June 24th, 2011, 12:29 am
by Jason Caldwell
Yes. It really sounds like you might want to just go with a custom template file of our own to accomplish this and anything else you need to do. Please see the excerpt below for instructions.

Is it possible to modify the PayPal® and/or Authorize.Net® Pro Form templates?
Usually not necessary. But yes, if you really need to. Please check your /s2member-pro/includes/templates/forms/ directory. You can take the default templates, and place some ( or all of them ) into your own WordPress® theme directory. s2Member Pro will automatically find your custom templates there. By placing custom templates into your theme directory, you can be sure they won't get overwritten in a future upgrade. Either that, or you can just use the default templates like they are, and customize them with your own CSS rules inside the Stylesheet for your WordPress® theme ( i.e. style.css ). If you're using a PriMo Theme ( for instance, the s2Clean Theme ), check your Theme Options Panel, under: Custom CSS / Style Sheet.

Re: Different levels for coupon users and non coupon users

PostPosted: June 24th, 2011, 12:37 am
by Cristián Lávaque
^ After creating the template as explained there, you'd tell the shortcode to use it with the template attribute. WP Admin -> s2Member -> PayPal Pro-Forms -> Shortcode Attributes (Explained) -> template

template="" 100% optional. This can be a custom template file that exists inside your WordPress® theme directory. For example: template="checkout.html".


By the way, the template can also be a PHP file, not just an HTML one.

Re: Different levels for coupon users and non coupon users

PostPosted: June 24th, 2011, 3:08 am
by rainbowsurfer
Thanks again guys, might just be a bit over my abilities though. I think I'll live with the fix how it is. Cheers

Re: Different levels for coupon users and non coupon users

PostPosted: July 1st, 2011, 9:42 am
by rainbowsurfer
I thought the solution that Jason gave worked with creating the directory and file. But the problem I have now is that when I do another Pro form without the coupon code field when the person goes to check out a warning message still comes up to say a coupon code is needed.

Is there a code to place so that if the coupon code field is not in the Pro form no warning message will appear?

Re: Different levels for coupon users and non coupon users

PostPosted: July 2nd, 2011, 10:27 am
by Jason Caldwell
You could try adding a Conditional to your file.
Something like this might be nice.
Code: Select all
<?php
add_action 
("wp_head", "my_function");
function my_function ()
    {
        if (is_page (123))
            {
                echo '<script type="text/javascript">';
                echo "jQuery(document).ready(function(){ jQuery('input.s2member-pro-paypal-coupon').attr('aria-required', 'true'); });";
                echo '</script>';
            }
    }
?>
* See: http://codex.wordpress.org/Conditional_Tags

Re: Different levels for coupon users and non coupon users

PostPosted: July 2nd, 2011, 5:42 pm
by rainbowsurfer
That's brilliant Jason it's all working perfectly.
Many thanks