Advertisement
nshelper

Untitled

Aug 18th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. add_filter('woo_sl/html/max_instances_per_key', 'theme_html_max_instances_per_key', 10, 3);
  4.  
  5. function theme_html_max_instances_per_key($instances, $order_item_id, $licence_group_id)
  6. {
  7.     $order_id = WOO_SL_functions::get_order_by_item_id($order_item_id);
  8.     $order_licence_details = WOO_SL_functions::get_order_licence_details($order_id);
  9.     $product_licence_data = $order_licence_details[$order_item_id][$licence_group_id];
  10.     $max_instances_per_key = $product_licence_data->license_data['max_instances_per_key'];
  11.     $instances = ' - ' . sprintf(_n('1 seat', '%s seats', $max_instances_per_key, 'software-license') , $max_instances_per_key) . ' per key';
  12.     return $instances;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement