I'm trying to modify a course (from the course module) and a product (from ubercart). I want to remove the SKU (right now I'm just testing how to remove the required bit) and a few other fields as I'm selling only online products. I'm not great at using hook_form_alter() yet.

I'm trying to follow this tutorial, http://www.ubercart.org/comment/8749/Re-Removing-SKU-product-edit-page and I'm not quite sure where he is getting $form_id == 'product_node_form' - is that related to the content type?

I'm trying to do this on a course content type, so if so, that would explain why it isn't working for me.


1 Answer 1


The ID for a node form is built up in node_forms():

$forms[$type . '_node_form']['callback'] = 'node_form';

Where $type is the name of each type retrieved from node_type_get_types().

So generally speaking, if the content type is product, the form ID will be product_node_form, if the type is course the form ID will be course_node_form, and so on.

  • Hrm, doesn't actually work for some reason, so I guess I will be using devel now.
    – Jack Ryan
    Feb 28, 2014 at 15:14
  • Ah, my order of arguments was off.
    – Jack Ryan
    Feb 28, 2014 at 20:34

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.