How to Make Phone Number on The Billing Address Tab a Required Field (Not Custom Field)

Hi there, we are still on snipcart v2.0. Snipcart is great!

One problem I am facing: cannot make the phone number a required field on the Billing Address tab. It is a standard field. Please kindly help!

Best,
Monza

Hi @monzalui, thanks for reaching out.

For that you could use something like:

Snipcart.subscribe('page.validating', function(ev, data) {
    if(data.phone.length < 3) {
        ev.addError('phone', 'Please enter a phone number');
    }
});

You can read more about that here:

Thanks.