Commerce_price in custom form
I have been unsuccessfully trying to add a commerce_price field to a custom form with attempts like this one:
$form['myprice'] = array(
'#type' => 'commerce_price',
'#title' => t('price'),
'#description' => t('enter price.'),
'#default_value' => 5.0,
The alternative which is to add a decimal textfield and a currency select field is something I would like to avoid.
Searching the web and commerce code for something similar didn't get me anywhere. Being a drupal noob looking at the code in the commerce_price module did not help me get a clearer view on how to achieve this. All I can say is that it seems to me that since the price field implements all the custom fields hooks it should be usable in forms (but I am not even sure that this intuitive belief is true. For all I know using fields in forms might not be the same as declaring them for fieldable entities)
Many thanks in advance for any help or advice on the topic.
> the answer is that it is not feasible. check below comment for mode details.