OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Virtual Unique Products (AKA PIN and phonecard selling)
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Contribution Development
Pages: 1, 2
Silencer
Need some community assistance with testing smile.gif

Download at: here.

Contribution purpose: make osC suitable for "unique virtual" products selling - PINs, phonecards, etc.

How to use:
0. Install. Don't forget to set "Download enabled" and "Check stock".
1. Go to Products Attributes.
2. Create new option "PIN" or smthng like that.
3. Create new option value "Instant delivery" or smthng like that.
4. Add this option/value to product you need and check "Is PIN code" checkbox.
5. Go to Catalog - PIN loader and click Upload.
6. Choose needed product and enter some codes into form field (separated by newlines, spaces, commas or semicolons) and click Update button.

Little more explanations:

"Update" button in "PIN loader" set products quantity for all products with "Is PIN" attribute according to number of records in products_pins table.

"Minimum order status" in Configuration - Download is self explaining i hope. PINs will be showed to customer only if order status equal or greater that value of this option. If you use "instant payment" module - they will see PIN right on "Checkout success" page.

Now important warning:
ABSOLUTELY NOT FOR REAL USE! TESTING ONLY

This mod was NOT passed thru nice testing. PIN codes = money, so you don't want customers get them for free, right?

TO DO:
1. Images as PINs (phonecard scans for example). Some trick supposed, cuz they must be stored outside of htdocs.
2. PIN code in order confirmation e-mail.
3. You name it.

Waiting for comments.

Thanks.
Silencer
Bug found, update will be published soon. Don't install current version if you didn't already.
Silencer
Fixed version uploaded. Enjoy (if someone need this mod at all smile.gif ).
Gamble
Very interesting!
kandip
nice mod yo. have installed on my site... lets see how it works out... thanx... let us know when its gonna be final so that we can use to REAL on our sites biggrin.gif
axioma
can you provide a better instructions, because the instructions given on note path are a quite messy.

thanks
CPRG
YES, Yes, Yes...BRAVO...THIS WE NEED...
Early 21stCentury business is based on PIN codes of various kinds.
Prosim vas...How do we get your latest beta/build, please?
Your download version is a month old...we _hope_ you stayed excited about this????
Our app is limited to PIN codes in osC generated email and in SMS (SMS ME contrib).
Thank you very much...diky hodne moc grat cool.gif
Silencer
QUOTE (axioma @ Jan 25 2006, 02:18 AM) *
can you provide a better instructions, because the instructions given on note path are a quite messy.

thanks


What exactly unclear in my instructions?
Silencer
QUOTE (CPRG @ Jan 26 2006, 08:43 PM) *
YES, Yes, Yes...BRAVO...THIS WE NEED...
Early 21stCentury business is based on PIN codes of various kinds.
Prosim vas...How do we get your latest beta/build, please?
Your download version is a month old...we _hope_ you stayed excited about this????
Our app is limited to PIN codes in osC generated email and in SMS (SMS ME contrib).
Thank you very much...diky hodne moc grat cool.gif


There is no "latest build" at this time. I'm still awaiting more feedback to be sure that base code works as supposed.
andes1
QUOTE (axioma @ Jan 24 2006, 11:18 PM) *
can you provide a better instructions, because the instructions given on note path are a quite messy.

thanks

Virtual Unique Products (PIN & Phonecard selling)
Version 0.6 alpha
© 2005 <email address removed - bluenotemkvi>


Work in progress, not for production use!!!

###########
0.6 * Bugfixes in checkout_process.php and admin area.
+ Now correctly works if customer buys 2 or more PINs.
0.5. Initial release.



#############UPDATING#################
Overwrite pin_loader.php with new one.
Make to changes marked (UPD) below.

############# INSTALLATION ##############
Set following options in admin area:
Configuration - Download - Enable Download "true"
Configuration - Stock - Check stock level "true"
Configuration - Stock - Substract Stock "true"
Configuration - Stock - Allow checkout "false"


#FILE /admin/includes/database_tables.php
#AND
#FILE /includes/database_tables.php
#ADD BEFORE closing ?>
//PIN add
define('TABLE_PRODUCTS_PINS', 'products_pins');

#FILE /admin/includes/filenames.php
#ADD BEFORE closing ?>
//PIN add
define('FILENAME_PIN_LOADER', 'pin_loader.php');

#FILE /admin/includes/boxes/catalog.php (or where you want to)
#FIND
'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
#ADD AFTER
//PIN add
'<a href="' . tep_href_link(FILENAME_PIN_LOADER, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PIN_LOADER . '</a><br>'.


!!! If you have clean MS2 installation - you can copy files from "overwrite" folder
!!! and jump to DATABASE OPERATIONS section.
!!! Else copy files from /admin folder to your /admin folder and process everything below.

#FILE /admin/products_attributes.php
#FIND (~68)
$products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);
$products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);
$products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);
#ADD AFTER
//PIN add
$products_attributes_is_pin = isset($HTTP_POST_VARS['products_attributes_is_pin'])?1:0;
//PIN end

#FIND (next lines usually)
if (tep_not_null($products_attributes_filename)) {
tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')");
#CHANGE TO
//PIN change
if (tep_not_null($products_attributes_filename) || $products_attributes_is_pin) {
tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "', '$products_attributes_is_pin')");

#FIND (~120)
$products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);
#ADD AFTER
//PIN add
$products_attributes_is_pin = isset($HTTP_POST_VARS['products_attributes_is_pin'])?1:0;
//PIN end
#FIND (next lines again)
if (tep_not_null($products_attributes_filename)) {
tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "'");
#CHANGE TO
//PIN change
if (tep_not_null($products_attributes_filename) || $products_attributes_is_pin) {
tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "', products_attributes_is_pin='$products_attributes_is_pin'");
#FIND (~758)
if (tep_db_num_rows($download_query) > 0) {
$download = tep_db_fetch_array($download_query);
$products_attributes_filename = $download['products_attributes_filename'];
$products_attributes_maxdays = $download['products_attributes_maxdays'];
$products_attributes_maxcount = $download['products_attributes_maxcount'];
#ADD AFTER
//PIN add
$products_attributes_is_pin = $download['products_attributes_is_pin'];
//PIN end
#FIND (~780)
<td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
#ADD AFTER
<!-- //PIN add -->
<td class="smallText"><?php echo TABLE_TEXT_IS_PIN; ?></td>
<td class="smallText"><?php echo tep_draw_checkbox_field('products_attributes_is_pin', '', $products_attributes_is_pin,1); ?>&nbsp;</td>
<!-- //PIN end -->
#FIND (~871)
<td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
#ADD AFTER
<!-- //PIN add -->
<td class="smallText"><?php echo TABLE_TEXT_IS_PIN; ?></td>
<td class="smallText"><?php echo tep_draw_checkbox_field('products_attributes_is_pin', '', $products_attributes_is_pin,1); ?>&nbsp;</td>
<!-- //PIN end -->






#FILE /checkout_process.php
#FIND (~125)
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
#CHANGE TO
//PIN change
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename, pad.products_attributes_is_pin

#FIND (~146)
if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
#CHANGE TO
//PIN change
if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename']) || ($stock_values['products_attributes_is_pin']==1) ) {

#FIND (~180)
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
#CHANGE TO
//PIN change
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename, pad.products_attributes_is_pin

#FIND (~206)
if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
#CHANGE TO
//PIN change
if ((DOWNLOAD_ENABLED == 'true') && ((isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) or $attributes_values['products_attributes_is_pin'])) {
#(UPD) ADD AFTER
//PIN add
for($pincycle=0;$pincycle<$order->products[$i]['qty'];$pincycle++) {
if($attributes_values['products_attributes_is_pin']) {
$pin_query=tep_db_query("SELECT products_pin_id, products_pin_code FROM ".TABLE_PRODUCTS_PINS." WHERE products_id = '".$order->products[$i]['id']."' AND products_pin_used='0' LIMIT 1");

if(tep_db_num_rows($pin_query)=='0') { // We have no PIN for this product
// insert some error notifying here
$pin=PIN_NOT_AVAILABLE;
} else {
$pin_res=tep_db_fetch_array($pin_query);
$pin=$pin_res['products_pin_code'];
tep_db_query("UPDATE ".TABLE_PRODUCTS_PINS." SET products_pin_used='".$insert_id."' WHERE products_pin_id = '".$pin_res['products_pin_id']."'");
}
}
//PIN

#FIND (~226)
'download_count' => $attributes_values['products_attributes_maxcount']);
#CHANGE TO
'download_count' => $attributes_values['products_attributes_maxcount'],
'download_is_pin' => $attributes_values['products_attributes_is_pin'],
'download_pin_code' => $pin
);
#FIND (next line)
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
#(UPD) ADD AFTER
}

#FILE /includes/modules/downloads.php
#FIND (~25)
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");
#CHANGE TO
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays, opd.download_pin_code,opd.download_is_pin from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and (opd.orders_products_filename != '' or opd.download_is_pin='1') and o.orders_status>='".DOWNLOADS_AVAILABLE_STATUS."'");

#FIND (~51)
// The link will appear only if:
// - Download remaining count is > 0, AND
#ADD BEFORE
//PIN add
if ($downloads['download_is_pin']==1) { //PIN processing
$pinstring=$downloads['download_pin_code'];
echo '<td class="main">'.$downloads['products_name'].'</td><td class="main">'.$pinstring.'</td><td class="main">&nbsp;</td>';
} else { //usual stuff

#FIND (~74)
$downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n" .
' </tr>' . "\n";
}
#ADD AFTER
}




#DATABASE OPERATIONS
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`,
`configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (NULL, 'PIN Show status', 'DOWNLOADS_AVAILABLE_STATUS', '2', 'Order must have this or better status', 13, 4, NULL, NOW(), NULL, '');
ALTER TABLE `products_attributes_download` ADD `products_attributes_is_pin` TINYINT( 1 ) NULL DEFAULT '0';
ALTER TABLE `orders_products_download` ADD `download_is_pin` TINYINT( 1 ) NULL DEFAULT '0',
ADD `download_pin_code` VARCHAR( 250 ) NULL ;
CREATE TABLE products_pins (
products_pin_id int(11) NOT NULL auto_increment,
products_id int(11) NOT NULL,
products_pin_code char(250) NOT NULL,
products_pin_used tinyint(4) NOT NULL default '0',
PRIMARY KEY (products_pin_id)
)


#LANGUAGE CONSTANTS
#ADMIN AREA
define('TABLE_TEXT_IS_PIN','Is PIN code');
define('BOX_CATALOG_PIN_LOADER','PIN loader');

#CUSTOMER AREA
define('PIN_NOT_AVAILABLE', 'Products out of stock during checkout. Personnel notified.');


that were the instruccions... i know the text on word path is a little weird to read

edit - removed email address by request - bluenotemkvi
Zurik
Hello,

I need HELP! PLEASE!

I've installed this system and it is working, but I can't seem to get the pin numbers after the order has gone through.

I didn't receive the download page, it wasn't in my order confirmation and It wasn't on any screen after the order was processed. I just got thrown back to the main catalog page.

Is anyone else having this same issue or am I doing something wrong.

website is www.marinemomscards.com

I would really like to get the PIN along with the access number in an email.

I check the system after the test order and I still had the same amount of PINs in the PIN Loader.

I also had the same amount in stock.

So the order went through, but I never got my pin. huh.gif

Can anyone help me?
doni
Great Contribution - thanks a lot.

Current status for your info.

I have installed the contribution, and so far everything works fine.

1. I have uploaded the PINs in then admin panel, purchased them, run them down to zero, and at zero, the correct message is given to the customer.

2. I have uploaded news PIN, once stock is out, and the system picks up the new ones fine.

3. I will do some further more robust testing on this and let you know how I get one.

4. Nest steps might be (as you suggested), to see how to link the checkout-success email to the customers informing them of the PIN.

Well done ...
CPRG
Ladies and Gentlemen,
In the interests of everyone being on the same 'development page' here, so to speak, and because of the overwhelmingly important financial security aspects of such a contribution for individual members of the osC community who build and or operate eshops, could someone please put up a link to a clean full copy of the latest working copy of this contribution, please?
Otherwise, we seriously risk different teams 'reinventing the wheel' and making well-intentioned but still imperfect work-arounds to problems that may have been already acceptably solved by another team. It is gratifying to hear that people are happy with what they have installed, but we must all be working from the same coding solution set, please, or there will be a lot of duplicative and hence potentially wasted personal work, time and effort into redoing each other's solutions. Granted, there are serious issue of coding style and approach, but the idea in the Open Source Community is on effective collaborative work, of course. Our thanks to Silencer, once again, for getting this ball finally rolling!
Many thanks to all who have pounded keys working to make this one work well! ... cool.gif
doni
Perhaps searching for "Virtual Unique Products" in the Contributions section of this website might help you!
doni
QUOTE (CPRG @ Mar 16 2006, 09:07 PM) *
Otherwise, we seriously risk different teams 'reinventing the wheel' and making well-intentioned but still imperfect work-arounds to problems that may have been already acceptably solved by another team.


What other contributions are there?
CPRG
Hi Everybody...
Still cranking along, tyring to get things to work...
Has anyone found a good way to display the PIN prices in a table, of some type?
Drop down table...or searchable table...
Everybody here knows what I am talking about, I think.
Obviously it will not be inside this module(I assume), but it is related and anybody using this nice contribution, probably wants this, too....obviously...probably a specialized info box would be good.
Anyone with more experience....out there..what do you recommend PLEASE for eating a simple spreadsheet with 2-3 columns
Big Thanks to everybody else out there testing things, too...!
(...given time, teamwork and uncounted hours, this will all work great!)
svetur
Hi, i'm testing it on sandbox.paypal.
After payment has been made and i returned to merchant website ( my osscommerce page ) i got this error

1054 - Unknown column 'pad.products_attributes_is_pin' in 'field list'

SELECT products_quantity, pad.products_attributes_filename, pad.products_attributes_is_pin FROM products p LEFT JOIN products_attributes pa ON p.products_id=pa.products_id LEFT JOIN products_attributes_download pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '28'

[TEP STOP]

I think i followed all the instructions and i uploaded some pins. Unless i have to add more info to upload pins
besides the pins themselves???

thanks
svetur
hHi, disregard the last post, it doesn't let me delete.
I fix it, i was missing products_attributes_is_pin in the database.

But now i can finish the payment process but i do not get any pins? My pin_loader is full nothing was deducted.
Please help.

Thank you.
chac416
so is this module upto anything new ?
svetur
Hi, still having problems - my pins are not being deducted from the loader. Any ideas?
strictlypc
Hi There,

Couple of suggestions that I have would be:

(1) Ability to view and edit the Pin Codes that was uploaded
(2) Ability for the customer to "recharge" that Pin Code that was purchased earlier
(3) Ability for the customer to do pinless dialing
(4) And of course, the ability for the customer to receive the PIN code in their email

Thanks for this great contribution,
StrictlyPC
svetur
Bug!!!!! My Pin loader wasn't deducting pin number so i found a flaw ( i think ) here it is:
It was giving all pins because it wasn't checking if they were sold!!!!

file : admin/pin_loader.php

added twice in this file WHERE products_pin_used='0'.

case 'update':
$pins_query=tep_db_query("SELECT products_id,COUNT(*) AS pcount FROM ".TABLE_PRODUCTS_PINS." WHERE products_pin_used='0' GROUP BY products_id");
while($pin_res=tep_db_fetch_array($pins_query)) {
tep_db_query("UPDATE products SET products_quantity='".$pin_res['pcount']."' WHERE products_id='".$pin_res['products_id']."'");
}
$messageStack->add(PINS_QUANTIY_UPDATED,'success');

-------

<?php
$pins_query=tep_db_query("SELECT products_id,COUNT(*) AS pcount FROM ".TABLE_PRODUCTS_PINS." WHERE products_pin_used='0' GROUP BY products_id");
while($pin_res=tep_db_fetch_array($pins_query)) {
svetur
This modification lets you send pin codes to customer email.
That's how it looks:

------------------------------------------------------
Order Number: 23
Detailed Invoice: http://www.xxxx.com/catalog/account_histor...php?order_id=23
------------------------------------------------------

Call access number
xxxxxxxxxx
Dial - country code + phone number
No need for 011
If you have an problems contact us: xxxx@xxxxcom

Date Ordered: Friday 02 June, 2006

Products
************************************
$10 Calling Card
Pin code - 123455
$10 Calling Card
Pin code - 223456
$10 Calling Card
Pin code - 345678
$10 Calling Card
Pin code - 132456
$20 Calling Card
Pin code - 324567
$5 Calling Card
Pin code - 123211
************************************
4 x $10 Calling Card () = $40.00
1 x $20 Calling Card () = $20.00
1 x $5 Calling Card () = $5.00
Total: $65.00

Billing Address
------------------------------------------------------
and etc.....

--------------------------------
This is how it was done. I had to edit checkout_process.php and includes/languages/english/checkout_process.php

includes/languages/english/checkout_process.php

just add these lines:

define('EMAIL_TEXT_PROMOTIONS', 'Call any access number' . "\n" .
'xxxxxxx'. "\n" .
'Dial - country code + phone number' . "\n" . 'No need for 011' . "\n" . 'If you have any problems contact us: xxx@xxxxx.com' . "\n");
define('EMAIL_SEPARATOR_2', '************************************');

catalog/checkout_process.php

Find these lines and change the lines in the bold font:
(These lines add $10 xxxx, pin code - xxxxx )

if(tep_db_num_rows($pin_query)=='0') { // We have no PIN for this product
// insert some error notifying here
$pin=PIN_NOT_AVAILABLE;
} else {
$pin_res=tep_db_fetch_array($pin_query);
$pin=$pin_res['products_pin_code'];
tep_db_query("UPDATE ".TABLE_PRODUCTS_PINS." SET products_pin_used='".$insert_id."' WHERE products_pin_id = '".$pin_res['products_pin_id']."'");
$products_ordered .= $order->products[$i]['name'] . "\n";
$products_ordered .= 'Pin code - ';
$products_ordered .= $pin . "\n";



Find these lines and change $product_add line in the bold font:
( This line cleans up and displays your order summary )

$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_add .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . "\n";

Find these lines and add lines in the bold font:
( These lines display the dialing instructions and pins for customer's email )

$email_order = STORE_NAME . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
EMAIL_SEPARATOR . "\n\n" .
EMAIL_TEXT_PROMOTIONS . "\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments'])
{
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
EMAIL_SEPARATOR_2 . "\n" .
$products_ordered .
EMAIL_SEPARATOR_2 . "\n" .

$products_add ;

That's is it. Enjoy. Any questions, problems - post it.
wetzel
Great contribution!

I have gotten it working well on my site. I am going to take it live soon for selling access codes for some premium content. It's not high stakes, so I feel pretty comfortable with the contribution. (It is academic content, so it won't be like criminals will be breaking down the door!)

One thing I noticed. When I went through with some test customers, it seems that I am receiving two identical emails to the store as part of checkout process now, where before I was receiving one. I've combed through checkout_process.php and can't seem to locate where this might be coming from.

Any ideas?

(My site is pretty heavily modded)

Thanks again for a great contribution. It is exactly what I need!

Cheers!
svetur
Hi, in my case i get 2

Order process ( the same email that customer gets ) and one from paypal.
The first one is sent to

Send Extra Order Emails To xxx@xxx.com

I do not get the one to my main email address for some reason. My site is modified a lot too.
Eric T
I haven't used osC or this contrib yet. I need to have items uniquely numbered, like serial numbers, but in quantities up to 10k or even 30k per series/batch of items. Is there a way to generate these numbers automatically, say, with a starting number, and "upload" these "pins" en masse? If i want the series to start with a letter or two, is that possible also, and how many characters can be used? And/or is there a contrib that will generate unique serial numbers for each item sold as it is sold and record the number in the record, with a limit on how many can be sold in a series? Any idea?

I also would like to be able to have the system pick one serial number out of each series at random as a winner of a bonus prize and notify me of it by email (but not the customer yet). I could do this manually from sales reports, but a report with 10k or 30k pieces is bulky. I don't know how reporting contribs work; i assume they produce files that can be saved to disk, perhaps comma delimited. In such a case I could put it into Excel and pick one from there, and correlate it to the account number and notify the customer.

All help is much appreciated.
kogyarus
When i try the code into the paypal module contribution, it didn'y work. Is there any extra setting needed for the paypal module so that i can have the PIN shown in the email?

http://www.oscommerce.com/community/contri...erce_paypal_ipn

Below is what was in my testing email.
------------------------------------------------------
Order Number: 23
Detailed Invoice: http://www.xxxx.com/catalog/account_histor...php?order_id=23
------------------------------------------------------

Call access number
xxxxxxxxxx
Dial - country code + phone number
No need for 011
If you have an problems contact us: xxxx@xxxxcom

Date Ordered: Friday 02 June, 2006

Products
*************************************
4 x $10 Calling Card () = $40.00
Total: $40.00

Billing Address
------------------------------------------------------
and etc.....

--------------------------------
Rezolles_Net
Is this contribution ready???And....may I know what bugs inside??Need to be repair??

If the bugs listed here it may easier for people to identify.

Thx
Rezolles_Net
QUOTE (Zurik @ Feb 9 2006, 05:36 PM) *
Hello,

I need HELP! PLEASE!

I've installed this system and it is working, but I can't seem to get the pin numbers after the order has gone through.

I didn't receive the download page, it wasn't in my order confirmation and It wasn't on any screen after the order was processed. I just got thrown back to the main catalog page.

Is anyone else having this same issue or am I doing something wrong.

website is www.marinemomscards.com

I would really like to get the PIN along with the access number in an email.

I check the system after the test order and I still had the same amount of PINs in the PIN Loader.

I also had the same amount in stock.

So the order went through, but I never got my pin. huh.gif

Can anyone help me?



I experiencing the same problem as you....Anyone got suggestion??
Rezolles_Net
B
U
M
P

Please....Zurik...is your problem solved??and how??
Rezolles_Net
B
U
M
P
opurahman
Thanx for the contribution.

I think contributor should make a package then upload to contribution section.

Best regards.
-Arafat Rahman
Web Developer
Dhaka, Bangladesh
Rezolles_Net
QUOTE (opurahman @ Nov 27 2006, 06:13 AM) *
Thanx for the contribution.

I think contributor should make a package then upload to contribution section.

Best regards.
-Arafat Rahman
Web Developer
Dhaka, Bangladesh


Mr Arafat,may I know which package you downloading and what did you fix??I mean,if u install the contrib and you done anything else???

And,is the contrib working perfectly??Customers get pin code in email or etc??
Rezolles_Net
I found out that this contrib cannot working together with MVS contrib...Please be aware for those using MVS.(multi vendor shipping)
opurahman
Ya it is working fine.
I installed it and now running on my testing server.
Rezolles_Net
That is because u dont have MVS installed.....Hurm...anyone can solve this problem???MVS + VUP (virtual unique products)?

When I select the product....the MVS will create an error says "No shipping selected".Eventhough have set it to one of the shipping method.
opurahman
QUOTE (Rezolles_Net @ Dec 6 2006, 05:16 PM) *
That is because u dont have MVS installed.....Hurm...anyone can solve this problem???MVS + VUP (virtual unique products)?

When I select the product....the MVS will create an error says "No shipping selected".Eventhough have set it to one of the shipping method.


Oh !
I don't have MVS installed.
Rezolles_Net
Then u are lucky pinch.gif Coz......I totally need MVS in my store.. tongue.gif....so...i have to sacrifice tongue.gif
opurahman
Virtual Unique Products 0.7 uploaded here
http://www.oscommerce.com/community/contributions,3883

* PIN codes edit facility included.
* Products quantity update bug fixed.

Enjoy !
Rezolles_Net
Is this can be use with MVS??
opurahman
QUOTE (Rezolles_Net @ Dec 8 2006, 06:21 PM) *
Is this can be use with MVS??


Opsssss !
I am not sure.
svetur
This module is working fine - i have been using it for 6 months now. And what is MVS??????
svetur
"a
akora
QUOTE (svetur @ Jan 23 2007, 10:33 AM) *
This module is working fine - i have been using it for 6 months now. And what is MVS??????


Last version in december has appeared.
What version tried?
akora
QUOTE (svetur @ Jan 23 2007, 10:33 AM) *
.... And what is MVS??????

Multiple Virtual Storage (IBM)
http://linux.icf.bofh.ru/books/1/ch03s02.html
Zaitsev
Thanks for module!
Here some suggestions
On order delete it's desirable to return PIN to stock if 'order status' < 'PIN Show status' i.e. not shown to customer, so PIN not compromised
example

#FILE /admin/orders.php
//find
tep_remove_order($oID, $HTTP_POST_VARS['restock']);
//replace with
//VUP vlzstart
// tep_remove_order($oID, $HTTP_POST_VARS['restock']);
$ret = tep_remove_order($oID, $HTTP_POST_VARS['restock']);
if (tep_not_null($ret)){
$messageStack->add_session($ret, 'error');
}
//VUP vlz end


#FILE /admin/includes/functions/general.php
//////// if you want to return PIN on delete even when 'Restock product quantity' IS NOT CHECKED then
//find
tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
//BEFORE add
//VUP vlz +
//return pins in pool if pin is not shown orders.orders_status <DOWNLOADS_AVAILABLE_STATUS
$ret = '';
$sSQL = 'select orders_status from '.TABLE_ORDERS. " where orders_id = '" . (int)$order_id . "'";
$row = tep_db_fetch_array(tep_db_query($sSQL));
if ($row['orders_status'] < DOWNLOADS_CONTROLLER_ORDERS_STATUS){
tep_db_query('update '.TABLE_PRODUCTS_PINS. " set products_pin_used = '0' where products_pin_used = '" . (int)$order_id . "'");
}else{
$ret = 'PIN could not be returnet into PIN-pool - compromised';
}
//VUP vlz -



/////////// if you want to return PIN on delete ONLY when 'Restock product quantity' CHECKED then
//find
if ($restock == 'on') {
//AFTER ADD
//VUP vlz +
//return pins in pool if pin is not shown orders.orders_status < DOWNLOADS_AVAILABLE_STATUS
$ret = '';
$sSQL = 'select orders_status from '.TABLE_ORDERS. " where orders_id = '" . (int)$order_id . "'";
$row = tep_db_fetch_array(tep_db_query($sSQL));
if ($row['orders_status'] < DOWNLOADS_CONTROLLER_ORDERS_STATUS){
tep_db_query('update '.TABLE_PRODUCTS_PINS. " set products_pin_used = '0' where products_pin_used = '" . (int)$order_id . "'");
}else{
$ret = 'PIN could not be returnet into PIN-pool - compromised';
}
//VUP vlz -
Zaitsev
in admin - catalog - "Attributes - Add values" when you edit "Products Attributes " and attribute is PIN checkbox displayed as not checked.
some fix in query:
#FILE /admin/products_attributes.php
//find
if (DOWNLOAD_ENABLED == 'true') {
$download_query_raw ="select products_attributes_filename, ............
//INSERT after "select ^^^^^
products_attributes_is_pin,
//so query looks as
"select products_attributes_is_pin,products_attributes_filename,
// ^^^^^^^^^^^^^^^^^^
Zaitsev
QUOTE (Zaitsev @ Feb 12 2007, 01:44 PM) *
#FILE /admin/includes/functions/general.php
//////// if you want to return PIN on delete even when 'Restock product quantity' IS NOT CHECKED then
//find
tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
//BEFORE add
//VUP vlz +
//return pins in pool if pin is not shown orders.orders_status <DOWNLOADS_AVAILABLE_STATUS
$ret = '';
$sSQL = 'select orders_status from '.TABLE_ORDERS. " where orders_id = '" . (int)$order_id . "'";
$row = tep_db_fetch_array(tep_db_query($sSQL));
if ($row['orders_status'] < DOWNLOADS_CONTROLLER_ORDERS_STATUS){
tep_db_query('update '.TABLE_PRODUCTS_PINS. " set products_pin_used = '0' where products_pin_used = '" . (int)$order_id . "'");
}else{
$ret = 'PIN could not be returnet into PIN-pool - compromised';
}
//VUP vlz -
/////////// if you want to return PIN on delete ONLY when 'Restock product quantity' CHECKED then
//find
if ($restock == 'on') {
//AFTER ADD
//VUP vlz +
//return pins in pool if pin is not shown orders.orders_status < DOWNLOADS_AVAILABLE_STATUS
$ret = '';
$sSQL = 'select orders_status from '.TABLE_ORDERS. " where orders_id = '" . (int)$order_id . "'";
$row = tep_db_fetch_array(tep_db_query($sSQL));
if ($row['orders_status'] < DOWNLOADS_CONTROLLER_ORDERS_STATUS){
tep_db_query('update '.TABLE_PRODUCTS_PINS. " set products_pin_used = '0' where products_pin_used = '" . (int)$order_id . "'");
}else{
$ret = 'PIN could not be returnet into PIN-pool - compromised';
}
//VUP vlz -

//
//find about 10 lines below
tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "'");
}
//INSERT BEFORE "}"
return $ret;
//so it's look like
tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "'");
return $ret;
}
nimsgone
sorry was not intended for you
nimsgone
QUOTE (Zaitsev @ Feb 13 2007, 12:20 PM) *
in admin - catalog - "Attributes - Add values" when you edit "Products Attributes " and attribute is PIN checkbox displayed as not checked.
some fix in query:
#FILE /admin/products_attributes.php
//find
if (DOWNLOAD_ENABLED == 'true') {
$download_query_raw ="select products_attributes_filename, ............
//INSERT after "select ^^^^^
products_attributes_is_pin,
//so query looks as
"select products_attributes_is_pin,products_attributes_filename,
// ^^^^^^^^^^^^^^^^^^


I have a problem with your contrib..
after all changes , when i go to PIN LOADER I cannot see back the pin codes (after restock checked) , any idea ?
thanks,
nimsgone
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.