<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Featured Archives - WP Software License for WooCommerce</title>
	<atom:link href="https://wpsoftwarelicense.com/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>https://wpsoftwarelicense.com/category/featured/</link>
	<description>An easy and secure way to manage product licensing for WooCommerce</description>
	<lastBuildDate>Wed, 09 Mar 2022 18:49:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Generate a different number of keys than default, for a licensed product along with WP Software License</title>
		<link>https://wpsoftwarelicense.com/generate-different-number-keys-default-licensed-product-along-woocommerce-software-license/</link>
					<comments>https://wpsoftwarelicense.com/generate-different-number-keys-default-licensed-product-along-woocommerce-software-license/#respond</comments>
		
		<dc:creator><![CDATA[woocommerce-sl]]></dc:creator>
		<pubDate>Wed, 02 Aug 2017 14:13:52 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Featured]]></category>
		<guid isPermaLink="false">https://woosoftwarelicense.com/?p=634</guid>

					<description><![CDATA[<p>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: If the [&#8230;]</p>
<p>The post <a href="https://wpsoftwarelicense.com/generate-different-number-keys-default-licensed-product-along-woocommerce-software-license/">Generate a different number of keys than default, for a licensed product along with WP Software License</a> appeared first on <a href="https://wpsoftwarelicense.com">WP Software License for WooCommerce</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>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 <strong>woo_sl/generate_licence_keys_count</strong>. Multiple keys can be generated in a row, or none.</p>
<p>The example bellow change the default single key generator to all allowed for current licence group:</p>
<pre class="brush: php; title: ; notranslate">
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-&gt;functions-&gt;get_order_item_meta($order_item_id,  '_woo_sl',  TRUE);
            
            $group_max_allowed_keys     =   $_woo_sl&#x5B;'max_keys']&#x5B;$license_group_id];
            
            return $group_max_allowed_keys;   
        }
</pre>
<p>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:</p>
<pre class="brush: php; title: ; notranslate">
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-&gt;functions-&gt;get_order_item_meta($order_item_id,  '_woo_sl',  TRUE);
            
            $group_max_allowed_keys     =   $_woo_sl&#x5B;'max_keys']&#x5B;$license_group_id];

            $order_data         = new WC_Order($order_id);
            $order_products     = $order_data-&gt;get_items();

            $order_item_data    = $order_products&#x5B;$order_item_id];
            $quantity           = $order_item_data&#x5B;'qty'];
            
            return ($quantity * $group_max_allowed_keys);
        }
</pre>
<p>The post <a href="https://wpsoftwarelicense.com/generate-different-number-keys-default-licensed-product-along-woocommerce-software-license/">Generate a different number of keys than default, for a licensed product along with WP Software License</a> appeared first on <a href="https://wpsoftwarelicense.com">WP Software License for WooCommerce</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://wpsoftwarelicense.com/generate-different-number-keys-default-licensed-product-along-woocommerce-software-license/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
