1

Is there a way adding a phone number field (along with the e-mail) in the out-of-stock form that is being used from the commerce stock 7.x-2.2 module and commerce stock notifications 7.x-1.1 module?

I am using drupal commerce kickstart2 and when i have a product that is out of stock the above modules helps no to be able to add them in the shopping cart as long as it gives the option to fill in an e-mail address. I would like to add a phone number field as well under the e-mail address I was wondering if anyone knows how.

1
  • I answered without reading the whole question and then realized you were asking if you could add a field. The answer would be technical enough that if you are asking about it on here, I assume you're looking for a user-interface way of adding a field. As far as I know, the form is not extensible using the user interface and would require hook_form_alter() and field_default_form() api.drupal.org/api/drupal/modules!field!field.form.inc/function/…
    – joshmiller
    Jan 18, 2016 at 18:29

1 Answer 1

0

Ash joshmiller noted, you can add a field using a form alter and then add another custom submit handler to take the submitted values and do something with that data. You'll have to provide your own DB or come up with some method to store that data on the customer or product.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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