Your test users must be set to "standard" by admin for testing.
Code reads Profilememlevels table and will always pull active data and if promo is still not expired then it reads that.
So if your test member still has 3 days left on the promo then nothing will change till then.
Lets assume for a second that the code works great out of the box and that your paypal settings and admin payment settings are wrong.
With this assumption, lets make promo expire in a few minutes:
pen phpmyadmin and go to table "Profiles" and find ID of test member.
the ID is 7
\\\\\\\\\\\\\\
now goto Profilememlevels and find the entry for ID 7
fields:
IDMember = 7
IDLevel = 3
DateStarts = irrelevant
DateExpires = 2009-07-04 4:06:03
set the date and time to a few minutes from now and after that the next entry for ID 7 with IDLevel 4 will kick in
You can do this with all your Membership levels to test so you dont have to wait a day lol
I also like to use my clean the ProfileMemLevels table mod so I know there are no other entries.
To use, make duplicate, then open inc/membership_levels.inc.php
in function setMembership
change:
if($membershipID == MEMBERSHIP_ID_STANDARD)
{
//return if already Standard
if($currentMembership['ID'] == MEMBERSHIP_ID_STANDARD) return true;
//delete any present and future memberships
db_res("
DELETE FROM ProfileMemLevels
WHERE IDMember = $memberID
AND (DateExpires IS NULL OR DateExpires > NOW())");
if(mysql_affected_rows($GLOBALS['MySQL']->link) > 0)
{
return true;
}
else
{
return false;
}
}
to:
if($membershipID == MEMBERSHIP_ID_STANDARD)
{
// mrp moved the delete here where the work is done
db_res( "DELETE FROM `ProfileMemLevels` WHERE `IDMember` = '$memberID'" );
//mrp added for setting people to standard
$dateStarts = time();
$dateExpires = 'NULL';
db_res("
INSERT ProfileMemLevels (IDMember, IDLevel, DateStarts, DateExpires, TransactionID)
VALUES ($memberID, $membershipID, FROM_UNIXTIME($dateStarts), FROM_UNIXTIME($dateExpires), $transactionID)");
if(mysql_affected_rows($GLOBALS['MySQL']->link) <= 0) return false;
return true;
//mrp added for setting people to standard written for mysql4
}
With the above mod in place, log in as admin and goto a users profile and when you set people to standard all other entries are really deleted.
If you do not have another entry for ID 7 then your paypal settings are wrong.