Forums / General Questions / Selling software licences

Selling software licences

Started by more_solutions on 22 May 2006, 3:56 PM · Views: 51,385

Results 81 to 100 of 131
19 Jan 2010, 4:50 PM
#81
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Selling software licences

That isn't exactly what I need, however, it does have nice features. That basically creates the License IDs through the store. Does anyone know if anything else that exists? or at least have a way to implement what I'm trying to do?

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

19 Jan 2010, 4:53 PM
#82
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Selling software licences

Dont know of another...you may have to post in Commercial
Section for zencart coder who can create exactly what is required.

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

19 Jan 2010, 5:04 PM
#83
mattstuible avatar

mattstuible

New Zenner

Join Date:
Jan 2006
Location:
Montreal, QC, Canada
Posts:
39
Plugin Contributions:
0

Re: Selling software licences

Hello all:

I ran across this thread while trying to setup a download/license code system on my site.

I tried the code written by more-solutions (page 2 of this thread) in Zen 1.3.8a. By tweaking it slightly, it is now (almost) working.

First, I replaced all instances of "$this->products[$i]['id']" with (int)$this->products[$i]['id']. The original version returned the product id along with the product attribute hash code. With the (int), only the product id is returned.

Second, and this is a more serious problem, I removed the block of code that updates the product stock level. The problem here was that even for products without download attributes, this code would run during each order...since there are no license codes in the database for these products, the stock would be updated to zero!

Here is my updated version of more-solutions' code for order.php (disclaimer: I am not a trained PHP programmer...use at your own risk!!):

function send_order_email($zf_insert_id, $zf_mode) {
    global $currencies, $order_totals, $zco_notifier, $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='.(int)$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='.(int)$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']." license code".":\n".$dbres->fields['licences_code']."\n\n";
            $licences[(int)$this->products[$i]['id']][] = $dbres->fields['licences_code'];
            $dbres->MoveNext();
        }              
        // Update licences stock level REMOVED because it also updates stock of non download products
         
        
      }
// END: MSL - Licences Mod  
19 Jan 2010, 5:12 PM
#84
mattstuible avatar

mattstuible

New Zenner

Join Date:
Jan 2006
Location:
Montreal, QC, Canada
Posts:
39
Plugin Contributions:
0

Re: Selling software licences

One more thing: the stock level update code actually works well for downloaded products. Could we wrap this code in an IF statement to run only when a product has download attributes? However, I have no idea how to write this.

In its current form, this code also cannot deal with products that can be downloaded optionally (ie. software that can either be delivered or downloaded). Some sort of IF statement (that is true when the customer selects a download attribute) might make this possible?

19 Jan 2010, 5:17 PM
#85
davep avatar

davep

New Zenner

Join Date:
Feb 2008
Location:
Peoria, IL USA
Posts:
25
Plugin Contributions:
0

Re: Selling software licences

Have you looked here: Selling Software Licenses

19 Jan 2010, 6:02 PM
#86
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: Selling software licences

Thanks for the link. That thread brings up a good point... what if the transaction is cancelled? They'll still get the License ID with this method. Something I have to think about.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

19 Jan 2010, 6:10 PM
#87
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: Selling software licences

shirster:

Does anyone want to get together and pay for a customized module? I definitely need one right away. Please PM me if you are absolutely willing to pay, and able to pay immediately, for a module with the following features :

  1. Enter serial numbers in a text file or via admin
  2. Automatically sends unique serial number when payment is collected online (such as credit card)
  3. Can be triggered manually via admin when payment is collected offline (such as cheque)

I'll post in this thread if the features are updated so please check the rest of the thread.

Cheers,
Shirley

It depends on the price, but yes, I am willing to pay.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

19 Jan 2010, 6:12 PM
#88
davep avatar

davep

New Zenner

Join Date:
Feb 2008
Location:
Peoria, IL USA
Posts:
25
Plugin Contributions:
0

Re: Selling software licences

vooboo13:

Thanks for the link. That thread brings up a good point... what if the transaction is cancelled? They'll still get the License ID with this method. Something I have to think about.

Yes.
I use a work-around.
What I have been doing is to issue a serial number that the customer uses to activate the program (at their leisure) on my web site.

If the sale is cancelled I void that number so it can not be used in my activation database.

Dave

19 Jan 2010, 6:22 PM
#89
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: Selling software licences

mattstuible:

One more thing: the stock level update code actually works well for downloaded products. Could we wrap this code in an IF statement to run only when a product has download attributes? However, I have no idea how to write this.

In its current form, this code also cannot deal with products that can be downloaded optionally (ie. software that can either be delivered or downloaded). Some sort of IF statement (that is true when the customer selects a download attribute) might make this possible?

That's an interesting thought. I think I will handle that situation by putting 2 different products. A CD-ROM product and a "Downloadable" product. That way there's no attribute.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

19 Jan 2010, 6:25 PM
#90
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,717
Plugin Contributions:
0

Re: Selling software licences

Moderator's note - vooboo's thread has been merged into this thread.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

24 Jan 2010, 8:12 PM
#91
mattstuible avatar

mattstuible

New Zenner

Join Date:
Jan 2006
Location:
Montreal, QC, Canada
Posts:
39
Plugin Contributions:
0

Re: Selling software licences

I've been working hard on this (with my limited coding skills!) and have made some progress.

There are two important changes I've made to the code that moresolutions posted (http://www.zen-cart.com/forum/showthread.php?t=36391&page=2).

First, I've changed the SQL query to create the product_licenses table to:

CREATE TABLE `products_licences` (
  `licences_id` int(10) unsigned NOT NULL auto_increment,
  `products_id` int(10) unsigned NOT NULL default '0',
  `products_options_values_text` text default '',
  `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`)
) TYPE=MyISAM;

Also, the first change to the order.php file should be:

  function send_order_email($zf_insert_id, $zf_mode) {
    global $currencies, $order_totals, $zco_notifier, $db;

	// START: MSL - Licences Mod Modified by Matt
      $licences = array();

      $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=".(int)$this->products[$i]['id']
						   . " AND products_options_values_text='".$this->products[$i]['attributes'][0]['value']."'" //added my matt
                           . " AND orders_id IS NULL"
                           . " LIMIT ".$this->products[$i]['qty']
                       );
          $dbres = $db->Execute('SELECT licences_code FROM products_licences'
                       . ' WHERE products_id='.(int)$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']." license code".":\n".$dbres->fields['licences_code']."\n\n";
            $licences[(int)$this->products[$i]['id']][] = $dbres->fields['licences_code'];
            $dbres->MoveNext();
        }             
         

      }
// END: MSL - Licences Mod  

How it works:

Insert the product_licenses table in your database by running the query (above) using the Install SQL Patches in Zencart admin. Use PHPMyAdmin to insert licenses into this table. For each product, you need to enter the product ID, the option value corresponding to the downloadable product (find this in Admin->Catalog->Option Value Manager, and the license code (ie. add one entry into this table for each license code).

What is working well:

As it stands now, this mod allows a single product to be offered as either downloadable or non-downloadable (for example, a piece of software that can either be shipped or downloaded). It will only send a license code (in the confirmation email) for products where the downloadable attribute has been selected by the customer. It works fine even if there are both regular and downloadable products in the same order.

What isn't working:

I would like to set this up so that the stock level for a downloadable product corresponds to the number of available licenses in the product_licenses table. However, I haven't figure this out yet. So...this mod does NOT update stock levels. If there are no remaining licenses in the table, the order will still go through, but no code will be sent.

I would appreciate any comments or suggestions for improvement!!

25 Jan 2010, 7:11 AM
#92
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Selling software licences

I would appreciate any comments or suggestions for improvement!!

Try following code in /includes/classes/order.php
BACKUP THAT FILES FIRST

FIND

// do not decrement quantities if products_attributes_filename exists 
          if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) { 
            $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty']; 
            $this->products[$i]['stock_reduce'] = $this->products[$i]['qty']; 
          } else { 
            $stock_left = $stock_values->fields['products_quantity']; 
          }  

CHANGE TO

 // do not decrement quantities if products_attributes_filename exists 
//          if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) { 
            $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty']; 
            $this->products[$i]['stock_reduce'] = $this->products[$i]['qty']; 
//          } else { 
//            $stock_left = $stock_values->fields['products_quantity']; 
//          }  

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

26 Jan 2010, 10:11 PM
#93
xbox_memberships avatar

xbox_memberships

Zen Follower

Join Date:
Jan 2010
Posts:
157
Plugin Contributions:
0

Re: Selling software licences

I was directed to this thread by misty, greatly appreciated, but i forgot to mention that i have no knowledge whatsoever of php editing. to be honest i dont even know how to install a mod to my zen cart powered site. could really do with an add on to zen cart though for entering 25 digit codes that have been pre made by microsoft. I sell a total of 5 products on my site and would like to just enter the codes and take payment and have the system email the code on the order confirmation invoice or a seperate email if necessary. each code is unique. sorry for being thick but can anyone help on this one as i don't understand anything posted in this thread other than the explanations of whats been done. well to a point that is :(

28 Jan 2010, 2:11 AM
#94
mattstuible avatar

mattstuible

New Zenner

Join Date:
Jan 2006
Location:
Montreal, QC, Canada
Posts:
39
Plugin Contributions:
0

Re: Selling software licences

Hello "Xbox Memberships" (so...what exactly are you selling...)

The mod as I described a few posts back should do exactly what you're wanting (with the limitations I mentioned).

Editing the PHP code is simple...just download the original file from your Zencart directory by FTP, open it with a text editor (Notepad++ is a good one), locate the code and edit. As Misty said, backup files before making changes!

28 Jan 2010, 2:15 AM
#95
mattstuible avatar

mattstuible

New Zenner

Join Date:
Jan 2006
Location:
Montreal, QC, Canada
Posts:
39
Plugin Contributions:
0

Re: Selling software licences

Thanks for the suggestion Misty. However, what would be ideal for me (not sure if anyone else wants this) is for the stock to be calculated (during each order) as the number of licenses remaining in the product_licenses table for a given product id. The code by moresolutions did this, but it didn't discriminate between downloadable and non-downloadable products. I think we need just a simple IF clause around this code, but I'm not sure how to formulate this.

misty:

Try following code in /includes/classes/order.php
BACKUP THAT FILES FIRST

FIND

// do not decrement quantities if products_attributes_filename exists
if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) {
$stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty'];
$this->products[$i]['stock_reduce'] = $this->products[$i]['qty'];
} else {
$stock_left = $stock_values->fields['products_quantity'];
}

>  
> CHANGE TO
>  
> ```
 // do not decrement quantities if products_attributes_filename exists 
//          if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) { 
            $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty']; 
            $this->products[$i]['stock_reduce'] = $this->products[$i]['qty']; 
//          } else { 
//            $stock_left = $stock_values->fields['products_quantity']; 
//          }  
26 May 2010, 5:25 PM
#96
melonian avatar

melonian

New Zenner

Join Date:
Jun 2008
Posts:
8
Plugin Contributions:
0

Re: Selling software licences

Hi there,

Well I couldn't adapt Zen Cart for that, so I created a php & mysql site that would store the prepaid Pins on a database, and when made a payment via Paypal, it would send the Pin via email to the client and obviously, mark that Pin number as sent. :clap:

Cheers

Raul

16 Jun 2010, 11:53 PM
#97
cristaltech avatar

cristaltech

New Zenner

Join Date:
Apr 2007
Location:
Rustenburg, South Africa
Posts:
87
Plugin Contributions:
0

Re: Selling software licences

I have followed the thread here:
This is the issue I have: I coded a installation DVD that generates it codes with the Name of the Client and The Company Name that is drawn from the installers computer. It is then manually inserted into the program the DVD was created with and then issues the code.
The question is:
How do I insert it to the database so that it is retrieved and issued after payment confirmation is done?
I also sell prepaid airtime with codes I retrieve from a DASHBoard and want to sell it the same way.

27 Jul 2010, 3:40 AM
#98
evieao avatar

evieao

New Zenner

Join Date:
Jul 2010
Posts:
5
Plugin Contributions:
0

Re: Selling software licences

I was searching through the forum for just this question, and although this response helped, I need further help.

DrByte:

replace this code from the section I quoted earlier:$this->products_ordered_attributes .= ''; // $custom_insertable_text;with something like this:```
$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.

Where is the custom function? I don't understand how to move forward after adding in the code.

Thanks, in advance, for your assistance.

evie
24 Aug 2010, 6:58 PM
#99
eaglewu avatar

eaglewu

New Zenner

Join Date:
Jan 2007
Posts:
82
Plugin Contributions:
0

Re: Selling software licences

Can anyone tell me how to move the location of licence below the order details but before the shipping address area?
Also, how to send two codes at the same time?

25 Aug 2010, 1:34 PM
#100
davep avatar

davep

New Zenner

Join Date:
Feb 2008
Location:
Peoria, IL USA
Posts:
25
Plugin Contributions:
0

Re: Selling software licences

eaglewu:

Can anyone tell me how to move the location of licence below the order details but before the shipping address area?
Also, how to send two codes at the same time?

I am doing the same thing that you want to do. I provide a serial number for each product purchased. In the email, under each product purchased is displayed the serial number for that product. and below that is a short explanation explaining registration.

Here is the mod (as shown before) along with my changes in the order.php

// 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='.(int)$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='.(int)$this->products[$i]['id'] 
                           . ' AND orders_id='.$zf_insert_id 
                       ); 
        while(!$dbres->EOF) { 
            $this->licences_html .= '<p>'.(int)$this->products[$i]['id'].':<br><span class=licences_code>'.$dbres->fields['licences_code'].'</span></p>';		
            $this->licences_text .= "Here is the Serial Number for your program "."\n".$this->products[$i]['name'].":\n".$dbres->fields['licences_code']."\n\n"; 
            $licences[(int)$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
     $this->registration_html = $this->registration_text = '';
        $this->registration_text .=	"If you were assigned a Serial Number above for your program "."\n"
		                          . "you may use this Serial Number to register on our web site "."\n\n"
								  

    //      print_r($this);
    //      die();