Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Best Way to Give Buyers Unique Serial Numbers?


fasteddie

Recommended Posts

This is for a calling card company's oscommerce store. We will have a table of calling card numbers and pin #s. After the user purchases the item and pays for it, we would then need to send out the next available card number and pin #. I couldn't find a contribution that would fit my needs.

 

Should I just write a customized script in MySQL to spit out the next non-used calling card? Perhaps stores with unique downloads can help? Thanks.

Link to comment
Share on other sites

Should I just write a customized script in MySQL to spit out the next non-used calling card? Perhaps stores with unique downloads can help?

This is pretty much it for ideas. I don't think anyone is going to top it. Are you looking for help doing it? If so, how many digits are the calling card number and PIN?

 

Cheers,

Matt

Link to comment
Share on other sites

Create the table (with phpMyAdmin or other MySQL control software):

CREATE TABLE `call_nums` (
`call_nums_card` VARCHAR( 20 ) NOT NULL ,
`call_nums_pin` VARCHAR( 10 ) NOT NULL ,
`customers_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`call_nums_issued` TIMESTAMP ,
PRIMARY KEY ( `call_nums_card` ) ,
INDEX ( `customers_id` )
) COMMENT = 'Stores numbers and pins for calling cards';

In includes/database_tables.php, add

define('TABLE_CALL_NUMS', 'call_nums');

To assign the card to someone (PHP code for checkout_process.php):

tep_db_query("update " . TABLE_CALL_NUMS . " set customers_id='" . (int)$customers_id . "', call_nums_issued=now() where customers_id='0' limit 1");

To get the info to put into the email:

$call_nums_query = tep_db_query("select call_nums_card, call_nums_pin from " . TABLE_CALL_NUMS . " where customers_id='" . (int)$customers_id . "' order by call_nums_issued desc limit 1");
$call_nums_array = tep_db_fetch_row($call_nums_query);

to get you started.

 

Hth,

Matt

Link to comment
Share on other sites

I'm trying to do the coding myself, but I can't seem to understand how to connect my calling card table to the products. Also, how to correctly pass the correct calling card information after an order is placed.

 

I added calling_card_value (in $ amounts, $10, $20, $50) to my calling card table. Can anyone point me in the right direction? Thanks!

Link to comment
Share on other sites

tep_db_query("update " . TABLE_CALL_NUMS . " set customers_id='" . (int)$customers_id . "', call_nums_issued=now(), calling_card_value='" . $order->products[$i]['price'] . "' where customers_id='0' limit 1");

somewhere around where it inserts into TABLE_ORDERS_PRODUCTS

 

Hth,

Matt

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 1 month later...
  • 6 months later...
Nobody knows this?

1. Paypal does not allow selling calling card, this is agaist thier policy. There are other vendor/cc marchants that will. So you will have to find that. However I have seen some company do use paypal in selling pins.

 

2. There are some good script/shopping cart out there that are customzed only for selling pins. They can sell nontangible items too. Email me off line if you are interested in geting a list of this. Hope this helps

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...