Hi,
There is no ready made element for this exactly.
In HikaShop Business, you have the "Google Products" plugin which you can configure via the Joomla plugins manager.
If you edit it, you'll see an option "categories" where you can select categories so that the XML file generated by the plugin will only contain products from the selected categories.
Using that selector in your own plugin is easy. If you look at the XML of the Google Products plugin ( folder plugins/hikashop/google_products/ ), you'll see this option implemented like this:
<field name="categories" multiple="true" namebox_type="category" type="hikanamebox" default="" label="PRODUCT_CATEGORIES" description="GOOGLE_PRODUCTS_CATEGORIES" />
Joomla has a list of standard field types here:
docs.joomla.org/standard_form_field_types
You can see that the type "hikanamebox" is not among them. It's a custom type HikaShop makes available so that you can use the advanced selectors available in the interface of HikaShop here and there.
Note also that to be able to use it, the plugin XML file also has this line:
<fields name="params" addfieldpath="/components/com_hikashop/fields">
The folder /components/com_hikashop/fields/ is where HikaShop has its custom field types, including the file hikanamebox.php hich defines that type. If you check that file, you'll see that it loads HikaShop and uses the type.namebox of HikaShop and follows the recommendations here:
docs.joomla.org/Creating_a_custom_form_field_type
So, the quick solution is to add in your plugin XML the same addfieldpath attribute, and you'll be able to use the type "hikanamebox" with the "namebox_type" attribute set to "category" and the "multiple" attribute set to true. That way, you'll get the same category selector.
And, building on all of this, you can also have your own fields folder in your plugin, and have your own custom type file in it, so that your plugin can reference it in its XML. With your own type, you can run the MySQL queries you want, run the PHP code you want, and output the option with checkboxes, the auto select of the children radios with some javascript code, etc. It will be quite a lot more work than reusing the hikanamebox type, but maybe it's worth it.