In the case where you wish to sell variable licenses based on the number of sites a single license can be activated on, you can achieve this by using WooCommerce’s Variable Product type or Variable Subscription if you are using WC Subscriptions. To achieve this, you will have to do the following:
Step 1: Create a variable product
Step 1: Create a variable product
Start by creating a new product or edit an existing product that already has the software attributes like so:
- Go to your WordPress Admin and click ‘Products > Add New’ or click ‘Products’ and click on the title of the product you want to edit if you already have one.
- Select Variable Product / Variable Subscription from the Product Data dropdown.
Step 2: Add attributes for variations
- Click on ‘Attributes’ tab to show the attributes panel
- Click ‘Add’
- Type the name of the attribute
- Type in the attributes seperated by ‘|’
- Select the ‘used for variations’ checkbox
- Click ‘Save Attributes’
Step 3: Create variations from attributes
- Click on ‘Variations’ to open variations panel
- Select ‘Create variations from all attributes’
- Click ‘Go’ to create variations based on all attributes. Click ‘Ok’ if you are prompted to confirm.
- Expand each variable to add specific variation data
Step 4: Add license and download details
- Make sure you are on ‘Variations’ panel by click ing ‘Variations’
- Select the variation you want to edit like ‘1 Site’ in the example
- Choose the ‘Enabled’ checkbox to enable the variation and then select ‘Downloadable’ to make the variation a downloadable product and to reveal the required licensing fields. You may also wish to select ‘Virtual’ to hide shipping details.
- Specify the price for this variation
- Provide a description
- Specify download details, that is the Name of the download and the File Url
- Choose the Software License Type. This specifies how frequent the license will be renewed
- Provide the ‘Activation Limit’ and ‘Staging Activation Limit’. These limits define how many times a license may be activated on a live or staging site respectively. So for a single site you should set it to 1.
- Repeat 2 to 9 for all the variations created, adding the unique details as required and most importantly set the ‘Activation Limit’ according to the number of sites the license is allowed to be activated on. This means for 5 Sites, set ‘Activation Limit’ to 5 and 20 for 20 sites as we have in the example, the staging activations can be different from the live activations depending on your needs.
- Click on ‘Save changes’ to save variations and lastly click on ‘Publish’ or ‘Update’ to update the product.
Step 5: Software details
Now you should add the software details. Since the software details will be the same for all the variations this will be added only once in the ‘License’ panel.
- Click on ‘License’ to show the license panel.
- Fill in the license details, see this document for details
- Update or publish the product.
What customers see
When a customer visits the single product page, they should be able to choose a variation they prefer by selecting from the dropdown. In the example we used ‘Number of sites’ and now the customer can select the number of sites they want to activate the license on. If they purchase the product, they will receive licenses based on the quantity of the product they purchased but they will be able to activate each license as many times as all owed by the number of sites they selected. So if they select 5 sites they will only be able to activate each license on 5 live sites and staging sites as specified.
You may also want to provide variations based on the Software License Type like in combination with the number of sites or activations. Like for example, you may want to provide 1 site license that renews Monthly, Annually and Lifetime. To achieve this do the following:
- Create an additional Attributes by following step 2 above, name it ‘License Type’ then add ‘Monthly | Annual | Lifetime’ in the attribute value(s) field or define values as you wish but corresponding to the available Software License Types
- Create Variations by following Step 3 above. You may want to create both attributes first before bulk creating the variations automatically to simplify things. The combinations for the variations should look like in the screenshot below.
4. Expand each variation and choose the Software License Type and Activation Limit accordingly. So now you can have a 5 Sites License that is available for Monthly, Annual and Lifetime options. The customer will see options like in the screenshot below on the single product page.