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.

Different Subs Costs depending on Month

Home Forums Community Forum Different Subs Costs depending on Month

This topic contains 5 replies, has 4 voices. Last updated by  Cristián Lávaque 3 years, 6 months ago.

Topic Author Topic
Posted: Tuesday Jul 9th, 2013 at 4:15 am #53149
Simon Groves
Username: prg

Hi All,

Hope someone can help with this!

Our client offers multiple levels of membership and depending when you join, depends on the costs you pay. The club runs renewal from april to april. So if you joined at the start you’d pay 12 months, yet if you join in the last part of the club year, you may only need to pay for 2 or 3 months.

On top of this, the member can also select from the membership level.

What the client wants, is depending which month you’re in, the right payment term to be predefined, then the only thing the member needs to worry about is which membership level they require.

Is there anyway that the plugin can already cater for this or is there some simple code logic that can be used? Am not a coder by trade so any help is much appreciated!

Thanks in advanced

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Thursday Jul 11th, 2013 at 9:12 am #53286
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

Sorry about the delay.

First off, the way that you’d begin working on this is to check out the article on Variables in a Shortcode:

Knowledge Base » Using Variables In A Shortcode

You’ll need to check the current date for the month. This PHP function can help you do that:

http://php.net/manual/en/function.date.php

To get a numeric representation of the month, you’d use this: date('n'). Knowing this, you can start using conditionals to change the price of your Pro Form dynamically. Here’s a really simple example that will make the price of membership $10 in January, and $12 any other time:

<?php
$price = 12.00;
if(date('n') === '1')
	$price = 10.00;
?>

[s2Member-Paypal-Button.... ra="<?php echo $price; ?>" ...]
Posted: Thursday Jul 11th, 2013 at 9:35 am #53293
Eduan
Username: Eduan
Moderator

Hello Simon,

So if I understood correctly you want the button to change automatically depending on the date?

So it’s renewals on April and a normal payment button the rest of the year?

– Eduan

Posted: Thursday Jul 11th, 2013 at 10:01 am #53296
Simon Groves
Username: prg

Hi Guys,

Many thanks for the replies.

Basically, a member needs to select the membership type they require. Then, depending which month of the financial year we’re in, will depend on how much they pay.
So, for example:
April (Full year)
Level 1 – £79
Level 2 – £151
Level 3 – £208

In July however,
Level 1 – £59
Level 2 – £113
Level 3 – £156

In Nov it may be,
Level 1 – £32
Level 2 – £63
Level 3 – £86

It really does depend which month they join as to which cost they’re charged. Hopefully, this makes sense?

Thanks again

Posted: Thursday Jul 11th, 2013 at 10:30 am #53297
Simon Groves
Username: prg

I think Bruce’s solution may work!

Do you still need the PHP Execution plugin as it’s now no longer supported?
Thanks

Posted: Friday Jul 12th, 2013 at 7:03 am #53334

You need a PHP execution plugin for PHP to work in a WP post/page, yes. It doesn’t have to be one particular plugin, there are several that do it. Search the WP plugins repository and try a few. Most of them will require that you use only the text editor and not open the post in the visual editor, since the latter will break the code.

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.