Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A while back I built a site with Ubercart 7.x-3.0-beta3 and I can edit checkout fields at admin/store/settings/checkout/fields to make the phone number required. I've recently built another site, this time using Ubercart 7.x-3.8 and now I cannot easily make the phone number required. I've looked up and saw I could do this
You can use a hook_form_alter() on 'uc_checkout_form' to change
$form['panes']['delivery']['delivery_phone']['#required'] = true;
BUT I do not know how to implement hook_form_alter
Is there an easy way to make the phone number required at checkout? If the only way to do this is through hook_form_alter how exactly would I do that?
Comments
Comment #1
TR CreditAttribution: TR commentedadmin/store/settings/countries/fields
Comment #2
fineartist99 CreditAttribution: fineartist99 commentedThank you so much.