Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Send user an Authorisaiton code for software downd


d912mv

Recommended Posts

Posted

Hi,

 

I have some software which is available to download only. The user downloads a trial version but needs an activation key code to run it properly. I have a list of codes i want to distribute, one per purchase. How can i email this code to the user?

 

I can't find any easy way to do this with the current setup and can't find any relative contributions. I am a competent coder so if you could point me in the right direction then i could give it a shot. Aplogees if this is in the wrong forum section.

 

Thanks,

Dan

Posted

an additional table - for activation keys.

 

each time a product is ordered - the next record is used in the table to include activation code in email to the customer sent in checkout_process.php and then that record is deleted.

Your online success is Paramount.

Posted
  I am a competent coder so if you could point me in the right direction then i could give it a shot. 

 

 

But I'm not a competent coder. So :blush: rry

 

how can I configure the parameters of that table.

(well at least i know a little bit obout create tables) :D

THANKS FOR YOUR HELP.

:rolleyes:

Posted
But I'm not a competent coder. So :blush: rry

 

how can I configure the parameters of that table.

(well at least i know a little bit obout create tables) :D

THANKS FOR YOUR HELP.

:rolleyes:

 

I managed to get it working..... this is my code...

 

// test for product ids
$tthhG = tep_get_prid($order->products[$i]['id']);


// search software_codes

$tres = tep_db_query("SELECT * FROM software_codes WHERE products_id = '$tthhG' AND customer_id = 0 LIMIT 1");
if(tep_db_num_rows($tres) > 0)
  {
       $tres_vals = tep_db_fetch_array($tres);
       $newProdNo = $tres_vals['code'];
    $sw_id = $tres_vals['sw_id'];



// then add customer id to code
$tres = tep_db_query("UPDATE software_codes SET customer_id =  \"$customer_id\" WHERE sw_id = \"$sw_id\"");

if($newProd == "")
   {
	 $newProd = "Your product activation code for Poker Clock is " . $newProdNo . "<br><br>";
   }
else {
	 $newProd = $newProd . "Your product activation code for Poker Clock is " . $newProdNo . "<br><br>";
}
}

 

Basically, created a table called software_codes with sw_id, products_id, code and customer_id as fields. When a product is ordered which is in the table then the variable $newProd is appended with the text "Your prod activaiton code is xxxx" It seems to work fine and i have tested it a bit but i doubt it's text book coding. Hope this helps, nice to be of asssitance once in a while. P.s. you then need to as $newProd to the email confirm code. Also, the above code should go in the for loop, about line 125 i tihnk, all in the checkout_process.php file

 

dan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...