apowers98 Posted June 6, 2014 Share Posted June 6, 2014 So pretty much what I need to do is create around 200 one-use coupon codes, each unique and one-use, so that I may give one person two codes, (or 10) and they may use all 10 codes, but the same code cant be used twice. I have seen add-ons that do this, but they all cost money, and I have used all my money. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
WebsiteIntegrations Posted June 7, 2014 Share Posted June 7, 2014 Well more then likely unless you want to spend money your going to have to generate them one by one. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted June 8, 2014 Share Posted June 8, 2014 If you know php and mysql you could write a script to do this by inserting records into the tblpromotions table. Here is an example script I wrote awhile back to generate 10% off recurring promo codes for a list of product ids to get you started: require("dbconnect.php"); require("includes/functions.php"); for ($i = 1; $i <= 200; $i++) { $promo_code = generateRandomString(; $value = "10"; $products = "1,4,9,52,53,56,58,60"; $exp_date = "2013-09-30"; print $promo_code . ' '; $results = insert_query("tblpromotions", array("code" => $promo_code, "type" => "Percentage", "recurring" => 1, "value" => $value, "cycles" => "Monthly,Quarterly,Semi-Annually,Annually","appliesto" => $products, "requires" =>"","requiresexisting"=> 0, "startdate" => "0000-00-00","expirationdate" => $exp_date, "maxuses" => 1,"applyonce" => 1, "newsignups"=>0, "existingclient" =>0, "onceperclient" => 1, "recurfor" => 0, "upgrades" =>0, "upgradeconfig" => "", "notes"=> "")); } function generateRandomString($length = { $characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; } If you don't know php then I would recommend purchasing this addon for $15, I haven't tried it but it looks like it does what you are wanting to do. https://www.whmcs.com/appstore/2290/Bulk-Promotion-Code-Generator.html 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.