I want to hide some fields of product reference on node edit. My purpose is to unset or set access to false for colors or price field of line item included in node as inline entity from in a content type. I am using hook as

unset($entity_form['field_product_colors']); // remove "colors" field from inline entity form

but hook is not called at this screen when user edit a product on node edit i have shared a node edit screen where product is edited by click on edit link and then update some thing but dont want colors and price to be shown thereenter image description here


Actually documentation of module in readme file the hook was written and i was using that hook but only problem was the custom module name. if your custom module name is two parts like custom_websitename then this hook did not work in my case, so after one day i changed module name to single word and hook worked.. I am sharing code incase someone need to update lineitemform in node edit for drupal commerce.

function customruba_inline_entity_form_entity_form_alter(&$entity_form,   $form_state){

this worked for me to hide some information on inline entity form

| improve this answer | |

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.