By woocommerce-sl, on , posted on March 7, 2018

Licensing expiration can apply to any licence, the set-up is very easy complete, and it’s been described at Create expiration for license product. A time range availability is set for an expiring licence, meaning after predefined end date the keys will go offline. (more…)

Read more

By woocommerce-sl, on , posted on August 30, 2017

Use a Predefined Key Multiple Times for Different Customers

WooCommerce Software License lets you manage and distribute license keys with ease. Normally, each key is unique and issued once. However, there are scenarios—such as beta testing or bulk giveaways—where you want the same key to be assigned multiple times. Thanks to our Predefined Keys feature and a simple “dynamic tag” syntax, you can control exactly how many times a single key is used before it’s retired.

What Are Predefined Keys?

A Predefined Key is an existing license string that you upload (or import) into WooCommerce Software License instead of having it generated automatically at purchase time. You might use this when:

  • You already have keys produced by another system.

  • You want to reserve a specific pool of keys for promotions.

  • You need to manage manual assignments for enterprise customers.

By default, each of these keys can only be sold once—but you can easily allow multiple assignments with the dynamic‐usage tag.

Allowing Multiple Uses with a Dynamic Tag

To specify that a predefined key can be issued more than once, simply prepend a count tag in curly braces to the key itself:

<strong>{15}</strong>D74DE8F47A4756F9CDC2A23519CF7
  • {15} tells the system this license may be sold up to 15 times.

  • Each time an order is processed that assigns this key, the remaining count is decremented.

  • Once the count reaches zero, the key is automatically removed from the pool of available keys.

 

Common Use Cases

  • Beta Testing
    Issue the same key to a controlled group of 50 testers without manually tracking assignments.

  • Promotional Bundles
    Run a giveaway where the promo code is the same license string but valid only for the first 1,000 claimants.

  • Corporate Discounts
    Give each department in a company a shared key with a 100‑seat limit, and let them self‑manage activation.

 

Best Practices

  • Set a Conservative Count
    Don’t overestimate your needs—start with a smaller number and increase if demand spikes.

  • Track Your Campaigns
    Use clear naming conventions (e.g., {100}SUMMER2025-KEY) so you know which promotion a key belongs to.

  • Replenish Early
    Monitor the “Remaining Uses” column and import more keys before your count runs out.

 

By combining Predefined Keys with the simple {n} usage tag, WooCommerce Software License makes it effortless to reuse the same license across multiple orders—while still keeping tight control over your distribution limits. Give it a try on your next promotion or internal rollout, and see how much smoother license management can be!

Read more

By woocommerce-sl, on , , posted on August 2, 2017

By default, whenever a client purchases a licensed product, a single key is generated and saved within the account. This can be changed through the filter woo_sl/generate_licence_keys_count. Multiple keys can be generated in a row, or none.

The example bellow change the default single key generator to all allowed for current licence group:

add_action('woo_sl/generate_licence_keys_count', 'woo_sl_generate_licence_keys_count', 10,  4);
    function woo_sl_generate_licence_keys_count($generate_keys_count, $order_id, $order_item_id, $license_group_id)
        {
            global $WOO_SL_API;
            
            $_woo_sl    =   $WOO_SL_API->functions->get_order_item_meta($order_item_id,  '_woo_sl',  TRUE);
            
            $group_max_allowed_keys     =   $_woo_sl['max_keys'][$license_group_id];
            
            return $group_max_allowed_keys;   
        }

If the order contain multiple quantity of an item, the user will be able to generate a maximum_group_licence_keys multiplied with quantity. So accordingly the code become something like this:

add_action('woo_sl/generate_licence_keys_count', 'woo_sl_generate_licence_keys_count', 10,  4);
    function woo_sl_generate_licence_keys_count($generate_keys_count, $order_id, $order_item_id, $license_group_id)
        {
            global $WOO_SL_API;
            
            $_woo_sl    =   $WOO_SL_API->functions->get_order_item_meta($order_item_id,  '_woo_sl',  TRUE);
            
            $group_max_allowed_keys     =   $_woo_sl['max_keys'][$license_group_id];

            $order_data         = new WC_Order($order_id);
            $order_products     = $order_data->get_items();

            $order_item_data    = $order_products[$order_item_id];
            $quantity           = $order_item_data['qty'];
            
            return ($quantity * $group_max_allowed_keys);
        }

Read more

By woocommerce-sl, on , posted on August 1, 2017

As default the WP Software License plugin output a ‘X domains per key’ within the order page, client and admin e-mails, my account areas etc. This is because is presumed the purchasable is being linked to a domain (e.g. a downloadable software).

But this is not necessarily to say that way, arbitrary texts can be used depending on the Product type and profile. (more…)

Read more

By woocommerce-sl, on , posted on August 1, 2017

Assigning license groups to variation products in WooCommerce is a powerful feature of the WP Software License plugin. This functionality provides enhanced flexibility and control over licensing management, allowing businesses to tailor licensing options for individual product variation. (more…)

Read more

By woocommerce-sl, on , posted on August 1, 2017

Name
woo_sl/generate_license_key

Type
Filter

Arguments
(text) $license_key
(int) $order_id
(int) $order_item_id
(int) $license_group_id (more…)

Read more