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.

Add +1 Month to S2Member_Last_Payment Time

Home Forums Community Forum Add +1 Month to S2Member_Last_Payment Time

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

Topic Author Topic
Posted: Thursday Jul 26th, 2012 at 12:46 pm #20320
Robert Funge
Username: godrob

Hi guys,

I need some help with the code below please. All I want to do is display the date of the next payment by adding + 1 month. How can I achieve that please?

<?php
$s2member_last_payment_time = get_user_field('s2member_last_payment_time');
if (!empty($s2member_last_payment_time)) 
	echo '<h6 style="text-align:center;"><Strong>Next Payment:</strong> ' . date('M-d-Y', $s2member_last_payment_time) . '</h6>';
?>

Thanks Rob

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Thursday Jul 26th, 2012 at 9:37 pm #20349

Hi Robert.

You could try this:

[hilite pre_code]
Next Payment: ' . date('M-d-Y', ($s2member_last_payment_time + 2592000)) . '

';
// 30 days = 2592000 seconds.
?>
[/hilite]

I hope that helps. :)

Posted: Friday Jul 27th, 2012 at 10:25 am #20405
Robert Funge
Username: godrob

Thanks Cristián – that worked :)

Posted: Friday Jul 27th, 2012 at 11:38 pm #20477

Cool. :)

Viewing 3 replies - 1 through 3 (of 3 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.