1

I have a zero-dollar product that, once added to the cart, should never be removed until checkout is completed. Currently, that product has the "Remove" button, "Quantity" field, and Price that all products are displayed with in the cart. How can I remove those three items just for this one product/SKU?

Thanks!

1

You could achive this with hook_form_alter() and hide the field with $form['field_name']['#access'] = FALSE;

  • Thanks! Do you have any ideas/guidance on how I would target the form elements only for the specific product, and leave all the other products' form elements alone? – hockey2112 May 7 '14 at 19:49
  • I hope, you could get product id in the form, just make the changes only for the product id with in the if condition, – Leopathu Jun 6 '16 at 7:04

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.