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

A list of Predefined Keys can be used to assign existing keys to customers orders. These keys are pre filled and not being generated on the fly.
In specific scenarios, such keys are required to be used more that once, so they are not intended to be used as unique id’s. This can be achieved easily using dynamic tag along with the actual key text.

A regular key would appear like this:

D74DE8F47A4756F9CDC2A23519CF7

To make such key dynamic, to be used more than once, the following tag should be append on front of key content:

{15}D74DE8F47A4756F9CDC2A23519CF7

The integer within the brackets, is the number of times the key will be used and assigned to customers, in this particular example it means 15 times. On every new key assignment, the number will be reduced accordingly and saved within the list. So at a given moment there will be a clear status on the unassigned number of keys.

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

Starting with version 1.2.4, the WP Software License plugin introduces an innovative feature that allows license groups to be assigned directly to variation/variable products, providing greater flexibility and control over licensing management. (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