2

I am creating a custom form using the form api. I'd like to reuse the price field used by commerce, but I don't know how to include their form type in my own form.

8
  • possible duplicate of Price field with Currency outside of commerce and ubercart – beth Aug 26 '14 at 19:43
  • 1
    The question link in my opinion does not show me how to add it to a form using the form api. – Bobby Aug 26 '14 at 19:52
  • 1
    There's no "currency" or "price" or "money" fieldtype in the form API in core. – beth Aug 26 '14 at 19:54
  • I do have Drupal Commerce installed all ready. Is it simple to add the price field from that module to my form? – Bobby Aug 26 '14 at 20:01
  • Yes I think it is just like any other field, but 'type' would be the type defined by Commerce Price instead of a core type. If you look at the code of the field in the Commerce module it should be the same as that. – beth Aug 26 '14 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.