AbanteCart Community

eCommerce construction => How-to questions => Topic started by: shahiran12395 on August 08, 2019, 03:20:58 AM

Title: add new required form field
Post by: shahiran12395 on August 08, 2019, 03:20:58 AM
Hi, im trying to add new required form field for guest checkout. But the field still can be blank without value. how can i appear error message like email field?

here is my code

Code: [Select]
if (isset($_post['nric'])){
            $nric = $_post['nric'];
        } elseif (isset($_session['guest']['nric'])){
            $nric = $_session['guest']['nric'];
        } else{
            $nric = '';
        }
        $this->data['form']['fields']['general']['nric'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'nric',
                'value' => $nric,
                'required' => true,
            ));
Title: Re: add new required form field
Post by: abolabo on August 08, 2019, 03:40:23 AM
try to use $_session name in uppercase.
$_SESSION or use our wrapper $this->session->data[]