This topic is locked
[SOLVED]

 Why go to Paypal when Price is $0.00 ?

5/4/2008 7:03:26 PM
Members Template General Questions
E
erago author

If the price selected is $0.00 then why still send to the paypal page. why not process the registration and insert the values into "Beginpay" , "Endpay" , "Paypal" and "Active" of the Users Table according to the Dcount Value Selected and send to the login Page instead?
The reason I need this is so that I can offer my site free for a given period of time. to those who sign up during that time, then when I start charging for my site. the members that signed up during the free time period don't get a lifetime membership for free, but instead need to renew when there free membership expires.
and would also be helpful if I want to give free promotional memberships from time to time.
which Event(s) would I need to change? and what code would I need to insert or change where?

admin 5/5/2008

If you like to enable an access for any specific user set Paypal field value to 1, Beginpay to current date, Endpay to the date when access would expire.
If you like to do this automatically check PayPal_Submit event on the Login page.

E
erago author 5/12/2008

If you like to enable an access for any specific user set Paypal field value to 1, Beginpay to current date, Endpay to the date when access would expire.

If you like to do this automatically check PayPal_Submit event on the Login page.


I tried the first method you suggest. but a couple problems Paypal and BeginPay fields are processed properly, but Endpay, anything but values of now() or a exact date ( not what I had in mind, because that means I have to update my website every day, and change the date manualy so that everyone that signs up gets a full six months or one year membership etc.. for the $0.00 amount the seems to be such a problem)
I have tried to get it to calculate the new date, but you can't calculate a new date properly with now(), you can with CURDATE() but it won't display the registration page when I use that Function, so no one can sign up. not sure why.
and one more problem, even if I set a specific date or use now() I have noticed, that for some reason even though Paypal is set to 1 and the Beginpay and Endpay dates are set. after registration it still links to the payment pages, instead of the login page, but if I manually go to the Login page with my web browser then I can login with the new user account. this should be recognizied automatically, but it isn't.
the second recommendation, to do it automatically in the PapPal_Submit Event, I have spent a few days now trying, to make that work. with no luck. so what code ? and where in the event ?
Is this an Issue you plan to resolve in a update to the Members Template ?

I was supposed to Launch my site at the begining of this month, but this is my last issue with the functionality of the site. and I can't launch until it's resolved.

E
erago author 5/19/2008

Alright I have finally figured out a temparary solution,
in AfterSuccessfulRegistraion event

Delete the Original event there created by the members template and save it in a notepad file for later when you start charging for your site. then use this code for AfterSuccessfulRegistraion event:
//** Update Registration Information in users table ****

global $conn;

$strUpdate="UPDATE users

SET Beginpay = now(), Endpay = DATE_ADD(now(), INTERVAL 12 MONTH), Paypal = '1'

where Email='" . $userdata["Email"] . "' and Password='" . $userdata["Password"] . "'";

db_exec($strUpdate,$conn);
I am Using Email as Username, so if you are not, replace when ever it says Email with Username.

and you can change the interval to any number and or YEAR, MONTH, or DAY you want ie.. INTERVAL 2 YEAR, INTERVAL 15 DAY.
This will let me launch my site, and when I start charging I can either switch the Event back to its original or have the time to figure out where to fix the original code. so it will:
IF price=$0.00 then [ code for: Update Registration Information in users table ];

ELSE then [ code for: send to payment ]
still not sure how to extract the "DCOUNT" value that the users selects to integrate directly from the "Select Payment Page"

but hey now I have some time.
Thanks to everyone that offered their help on this one.

J
jasp 12/19/2008

Sergey / Jane
has there been any update on a straight forward solution to this, or just where to pout the code you suggest in the automatic solution,
thanks