woo_sl/html/max_instances_per_key

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPrint this page

Type
Filter

Arguments
text $instances
integer order_item_id
integer $licence_group_id

Description
Add / Remove / Change ‘instances per key’ text.

Example of usage
An example on how to change the text from ‘7 domains per key’ to ‘7 seats per key’:


add_filter('woo_sl/html/max_instances_per_key', 'theme_html_max_instances_per_key', 10, 3);

function theme_html_max_instances_per_key($instances, $order_item_id, $licence_group_id)
{
	$order_id = WOO_SL_functions::get_order_by_item_id($order_item_id);
	$order_licence_details = WOO_SL_functions::get_order_licence_details($order_id);
	$product_licence_data = $order_licence_details[$order_item_id][$licence_group_id];
	$max_instances_per_key = $product_licence_data->license_data['max_instances_per_key'];
	$instances = ' - ' . sprintf(_n('1 seat', '%s seats', $max_instances_per_key, 'software-license') , $max_instances_per_key) . ' per key';
	return $instances;
}


By woocommerce-sl, posted on August 1, 2017

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments