Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Promo Codes (http://www.mysidiaadoptables.com/forum/showthread.php?t=3764)

SilverDragonTears 06-29-2012 02:10 PM

Promo Codes
 
Why is it that I can't let each user on the site use the same promo code once each? I want to give everyone an item but only let them get it once each by entering the same promo code. How can I achieve this?

SilverDragonTears 06-29-2012 02:58 PM

I assume it's this part?

Code:


  private function checknumber(){
      $data = $GLOBALS['adopts']->select("messages", array(), "touser='{$loggedinname}' and status='unread'")->fetchAll();
         
      if($this->availability == 0){
            // The promocode has been used, so it is unavailable now...
               
                $this->message .= "The promocode has been used before and is now unavailable. Please contact the admin if you believe this is a mistake.<br>";
                return FALSE;
          }
          else return TRUE;
  }


Hall of Famer 06-30-2012 01:22 PM

Well because the way this system is designed does not support advanced usage of public promocodes. And in fact to make a promocode available for each user only once, it will require a bit more coding than I had envisioned at the very beginning. You need to create a field in your database table prefix.promocodes to keep track of a list of users who have used this specific promocode. It may not be difficult, but sure can be tedious.


All times are GMT -5. The time now is 04:18 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.