Page 2 of 13 FirstFirst 123412 ... LastLast
Results 11 to 20 of 125
  1. #11
    Join Date
    May 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Selling software licences

    Quote Originally Posted by savage View Post
    I would be interested in seeing the code you have so far. So please let me know how I can get a hold of it and if you have made any progress since May.
    I'll post this here since others have also asked about it. Regarding Absolute's concerns: that is an issue with any licence scheme. In my case I needed to sell licence codes for third party applications, ie they took care of ensuring that the licence only got used once (they had to do this anyway: the licence was buying access to a service for a period of time, so even the purchaser would have re-used it if they could!)

    Anyway, the instructions:

    === Selling licences with ZenCart ===

    == Basic concept: ==
    ~- Add a new table to store licences
    ~- Buy a product that has licences. During the email confirmation stage update the required licenes to match the new order ID.
    ~- Add those details to the email
    ~- Update stock level.

    == Comments ==
    ~- Not written a backend admin bit yet so for time being have to add licences manually to products_licences table
    ~- Instructions untested. I have done the changes and they work, but then wrote the docs. So the docs may miss something.
    ~- Email with licence(s) is sent with order confirmation. ''This is not good if payment hasn't been confirmed yet!'' OK for auto CC processing, not good with manual CC processing.

    == Details: ==
    Create a new table:

    Code:
    CREATE TABLE `products_licences` (
      `licences_id` int(10) unsigned NOT NULL auto_increment,
      `products_id` int(10) unsigned NOT NULL default '0',
      `products_attributes_id` int(10) unsigned default NULL,
      `licences_code` varchar(250) NOT NULL default '',
      `orders_id` int(10) unsigned default NULL,
      PRIMARY KEY  (`licences_id`),
      KEY `product_id` (`products_id`,`orders_id`),
      KEY `product_attributs_id` (`products_attributes_id`)
    ) TYPE=MyISAM;
    Add the code to includes/classes/order.php, function send_order_email():
    Was:
    PHP Code:
        function send_order_email($zf_insert_id$zf_mode) {
          global 
    $currencies$order_totals
    Now:
    PHP Code:
        function send_order_email($zf_insert_id$zf_mode) {
          global 
    $currencies$order_totals$db;

    // START: MSL - Licences Mod
          
    $licences = array();
        
    //$db->Execute('UPDATE products_licences SET orders_id=NULL');    // DEBUG!!!
          
    $this->licences_html $this->licences_text '';
          for (
    $i=0$n=sizeof($this->products); $i<$n$i++) {
              
    $db->Execute('UPDATE products_licences SET orders_id='.$zf_insert_id
                           
    ' WHERE products_id='.$this->products[$i]['id']
                               . 
    ' AND orders_id IS NULL'
                               
    ' LIMIT '.$this->products[$i]['qty']
                           );
              
    $dbres $db->Execute('SELECT licences_code FROM products_licences'
                           
    ' WHERE products_id='.$this->products[$i]['id']
                               . 
    ' AND orders_id='.$zf_insert_id
                           
    );
            while(!
    $dbres->EOF) {
                
    $this->licences_html .= '<p>'.$this->products[$i]['name'].':<br><span class=licences_code>'.$dbres->fields['licences_code'].'</span></p>';
                
    $this->licences_text .= $this->products[$i]['name'].":\n".$dbres->fields['licences_code']."\n\n";
                
    $licences[$this->products[$i]['id']][] = $dbres->fields['licences_code'];
                
    $dbres->MoveNext();
            }              
            
    // Update licences stock level
              
    $dbres $db->Execute('SELECT count(*) AS count FROM products_licences'
                           
    ' WHERE products_id='.$this->products[$i]['id'].' AND orders_id IS NULL'
                           
    );
            
    $db->Execute('UPDATE products SET products_quantity='.$dbres->fields['count'].' WHERE products_id='.$this->products[$i]['id']);
          }
    // END: MSL - Licences Mod 
    Was:
    PHP Code:
    //products area
            
    $email_order .= EMAIL_TEXT_PRODUCTS "\n" .
                            
    EMAIL_SEPARATOR "\n" .
                            
    $this->products_ordered .
                            
    EMAIL_SEPARATOR "\n";
            
    $html_msg['PRODUCTS_TITLE'] = EMAIL_TEXT_PRODUCTS;
            
    $html_msg['PRODUCTS_DETAIL']='<table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2">' $this->products_ordered_html '</table>'
    Now:
    PHP Code:
    //products area
            
    $email_order .= EMAIL_TEXT_PRODUCTS "\n" .
                            
    EMAIL_SEPARATOR "\n" .
                            
    $this->products_ordered .
                            
    EMAIL_SEPARATOR "\n";
            
    $html_msg['PRODUCTS_TITLE'] = EMAIL_TEXT_PRODUCTS;
            
    $html_msg['PRODUCTS_DETAIL']='<table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2">' $this->products_ordered_html '</table>';

    // START: MSL - Licences Mod
    // Licences Area
            
    if ($this->licences_html) {
                
    $html_msg['PRODUCTS_LICENCES']='<table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td>' $this->licences_html '</td></tr></table>';
                
    $email_order .= 
                            
    $this->licences_text .
                            
    EMAIL_SEPARATOR "\n";
            }
    // END: MSL - Licences Mod 
    == Modify the email template, email/email_template_checkout.html
    Was:
    Code:
    .copyright {border-bottom:0px solid #9a9a9a; padding:5px;}
    </style>
    Now:
    Code:
    .copyright {border-bottom:0px solid #9a9a9a; padding:5px;}
    .order-licences-area{background-color:#DDDDAA; border:2px #9a9a9a; width:542px; padding:2px; font-size:10px; }
    .licences_code{font-weight: bold; font-size: 12px; font-family: monospace;}
    </style>
    Was:
    Code:
    	<div class="order-detail-area">$ORDER_TOTALS</div>
    
    	<div class="comments">$ORDER_COMMENTS</div>
    Now:
    Code:
    	<div class="order-detail-area">$ORDER_TOTALS</div>
    	<div class="order-licences-area">$PRODUCTS_LICENCES</div>
    
    	<div class="comments">$ORDER_COMMENTS</div>

  2. #12
    Join Date
    May 2006
    Posts
    28
    Plugin Contributions
    0

    Default Re: Selling software licences

    Hi more-solutions,
    Thanks for sharing your code. It's greatly appreciated.

  3. #13
    Join Date
    Oct 2006
    Location
    New Albany Ohio
    Posts
    118
    Plugin Contributions
    2

    Default Re: Selling software licences

    savage, what mobile os did you want to enable direct downloads to?

    did you still need a key generator? here's a helpful hint if you want give it a go yourself: the function mapping has to be a one-to-one onto function.

    depending on how important your software is, you can make your domain-range scale quite large and the random seed more or less random. for example, intel has an rng that uses cpu thermal noise, which is truly random, unlike a lot of other software generated rngs.

    aside: i suggest using wikipedia if you need a math primer. i actually found some very useful information on the relationship between a family of statistical functions and sigmoidal neural network transfer functions there, something i didn't find elsewhere.

  4. #14
    Join Date
    May 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Selling software licences

    Has anyone developed a admin mod for this?

    This is perfect for what one of my customers needs, but having to add keys via phpMyAdmin is a bit cumbersome.

  5. #15
    Join Date
    Jan 2007
    Posts
    82
    Plugin Contributions
    0

    Default Re: Selling software licences

    Quote Originally Posted by Lord_Vyper View Post
    Has anyone developed a admin mod for this?

    This is perfect for what one of my customers needs, but having to add keys via phpMyAdmin is a bit cumbersome.
    I also want the admin mod. Can someone help?

    Thanks in advanced.

    What if I sell different types of licence keys? Does this also work?
    Last edited by eaglewu; 11 Feb 2007 at 05:22 PM.

  6. #16
    Join Date
    Jan 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: Selling software licences

    Hello,

    Quote Originally Posted by Lord_Vyper View Post
    Has anyone developed a admin mod for this?
    Quote Originally Posted by eaglewu View Post
    I also want the admin mod. Can someone help?
    I made such a mod for one of my sites. It is based on the same technique and also lacks the the admin part to manage licences (you have to use PhpMyAdmin to add licences). The licence attribution is manual, right now (just one click from the orders page, once the payment is validated), but I could probably easily integrate it with automatic payment confirmations such as PayPal.

    However, my mod is not ready for public release as it needs some cleanup and more functions for non-techies admins.

    I don't have much time to work on it right now, but I might consider it later if there are people willing to support its development by a donation. If you are, feel free to contact me by private message (I don't want to hijack this thread).

  7. #17
    Join Date
    Dec 2006
    Location
    Mesa, Arizona USA
    Posts
    39
    Plugin Contributions
    0

    Idea or Suggestion Re: Selling software licences

    For those who are having difficulty with the manual adds for the keys, have you considered using a GUID algorithum? This will allow you to generate the key on the fly (you could also add that key to the table at that time). A really neat GUID class can be found on PHP Classes site (http://www.phpclasses.org/browse/package/1738.html). I haven't done the math, (and I don't plan on it either) but the chances of having two keys the same are very slim. Check it out, it's a good starting place.

  8. #18
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Selling software licences

    We're looking at integrating the software download with third party authorisation/licensing. Here the idea:

    1. Shopper orders downloadable software from our zencart store.
    2. using curent zen configurations, point shopper to download file only when payment has gone through (so it's manual intervention at this stage).
    3. Shopper downloads software.
    4. Shopper installs software on his/her machine
    5. Activation popup asks shopper to link to remote authorisation server - and we're looking at MIRAGE for this purpose (mirage-systems.de) using their HOSTED authorisation option.
    6. Remote authorisation server generates authorisation code.
    7. Shopper enters code and activates software.

    Only challenge is... how do we supply each new shopper with a unique serial numbered software download. (The remote authorisation server will ask the shopper for the unique serial number of their software. It then looks up this serial number. If the number's unused, it generates an authorisation key. if there's a key already allocated to that serial number, it reject the application).

    So... we need matching serial numbers on the individual software downloads as are listed on the remote activation server.

    Looking at the above thread, it seems possible to "embed" a serial number in the order confirmation e-mail (or at least the "your download is now available" e-mail.)

    Any ideas on how we could look at integrating this feature?

    PS. I know zip about php !!!
    Last edited by Kim; 30 May 2008 at 12:52 AM.
    20 years a Zencart User

  9. #19
    Join Date
    Jan 2007
    Posts
    82
    Plugin Contributions
    0

    Default Re: Selling software licences

    Does the update the stock part need change?
    It seems also change the stock of product that is not in the product_licences.

    BTW, I am still looking for the admin part.

  10. #20
    Join Date
    Jun 2007
    Posts
    3
    Plugin Contributions
    0

    Default Re: Selling software licences

    Hi,

    Any news on this topic / instant code notification? I too am in the business of selling codes (although I sell pre-paid game cards and game keys) and have been deperately searching for a module / work-around to solve this problem but have found nothing (although quite a few people like myself looking for one).

    Best regards,

    GameCardsDirect
    *Instant* Pre-Paid MMORPG Game Time Cards and Game Keys sent via SMS and E-Mail! E-Gold and Credit Cards accepted.

 

 
Page 2 of 13 FirstFirst 123412 ... LastLast

Similar Threads

  1. Selling downloadable software
    By bazfr in forum General Questions
    Replies: 5
    Last Post: 4 Mar 2010, 10:13 AM
  2. Possible? Selling items in groups of 10 while selling other items as singles
    By alanekilauea in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 11 Feb 2008, 07:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR