More than you ever wanted to know about notifiers/observers: http://www.zen-cart.com/wiki/index.p...Observer_Class
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Hi there!
I've searched and I found some references but nothing too concrete about a product type that allows you to sell Phone Card Pin Numbers.
The "shop" would be really simple with TWO or THREE products of different prices (i.e. 10$ and 20$ recharge cards).
There would be X Pins (let's say a hundred pins each product).
Once somebody pays a 10$ prepaid card Pin, he/she would receive an email with one of the Pins, and obviously that particular pin would be deleted from the database.
I guess the functionality should be very similar to selling Software Licenses.
You have a number of X licenses, once somebody buys one, he's emailed the license so he can activate the application.
The only difference is that the licenses are not automatically generated, but they reside in a database.
Is there anything or anyone outther who has done this or know how could it be accomplished??
Thanks in advance :)
cheers
We are now selling downloadable ebooks as well as our othr products.
Our ebooks use a security feature requiring a unique PIN number which the customer must have to unlock the ebook after they download it.
What I would like is a way of delivering the PINs to the customer automatically.
There is a simple script that will display a PIN number when the page it is on is viewed.
Here's the catch, you cannot put this script on the 'checkout success' page because it has no way of differentiating between the sale of an ebook vs any other product, nor will it display more than one PIN if two ebooks were purchased.
Is there a module that might do this? Keep in mind, we only want a PIN displayed to the customer once they have made a successful purchase and only on the purchase of an ebook.
Many Thanks,
-Sheryl
You can hook into the logic in /includes/classes/order.php here:Code:/* START: ADD MY CUSTOM DETAILS * 1. calculate/prepare custom information to be added to this product entry in order-confirmation. * 2. Add that data to the $this->products_ordered_attributes variable, using this sort of format: * $this->products_ordered_attributes .= {INSERT CUSTOM INFORMATION HERE}; */ $this->products_ordered_attributes .= ''; // $custom_insertable_text; /* END: ADD MY CUSTOM DETAILS */
There are some other forum discussions on similar topics, such as phone cart pins, software serial numbers, etc. The concept is the same.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Well, I appreciate your reply but as a non-programmer that just means nothing to me. (and I actually have done a fair amount of zencart mods) I can see the order.php file but I have no idea what to do with the info above. Where is the product defined to which the script pertains ? Where is this to be inserted in the order.php file?
Thanks,
S
bump ----------------------------------------------------------------------
Rather than bumping (see the forum Posting Rules, link at top of forum page), I suggest you put a post in the Commercial Help Wanted area to hire someone to write the customization you require.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Well the bump is because things get buried very fast on this forum, I could have simply added a line saying something else other than the word 'bump' but I preferred to call a spade a spade :). Regarding a request in the commercial forum for custom work written, correct me if I'm wrong but your previous reply seemed to give the impression this could be done /had been done by adding some lines to an existing file.
Last edited by trillian; 10 Jul 2008 at 02:15 PM.
Yes, if you've written the custom code to generate or retrieve a PIN or serial number or code or key or whatever you need when needed, you can insert a function call to that custom code in the indicated section of Zen Cart code in the file indicated, and that will cause the PIN/serial/code/key value to be included in the order details and on the email confirmation. If your custom code also stores what order number was used at the time, then you will have that information for reporting purposes etc as well.
But if you don't yet have a way to run a PHP function to obtain the required serial number for the product you specify when you run the function, you'll need to have that done first.
Sample concept:
replace this code from the section I quoted earlier:with something like this:Code:$this->products_ordered_attributes .= ''; // $custom_insertable_text;And in your custom function treat the parameters as ProductID, Quantity, OrderNumber, and return a string value containing the serial number for the specified product.Code:$product_serial_number = my_custom_get_serialnumber_function($this->products[$i]['id'], $this->products[$i]['qty'], $zf_insert_id); $this->products_ordered_attributes .= $product_serial_number;
You could further enhance it by passing the specific attribute number as well if you needed to differentiate that further.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks