AbanteCart Development > Development Help Needed

adding new input

(1/1)

shahiran12395:
hi, im trying to add new input. but the label wont show. i have register definition using admin also add new definition in guest_step_1.xml but still no effect. below is my code. can advice me on how to do it. i need to insert phone code for different country


--- Code: ---<definition>
<key>entry_extension</key>
<value><![CDATA[Extension:]]></value>
</definition>
--- End code ---


--- Code: ---if (isset($_post['extension'])){
            $extension = $_post['extension'];
        } elseif (isset($_session['guest']['extension'])){
            $extension = $_session['guest']['extension'];
        } else{
            $extension = '';
        }

        $this->data['form']['fields']['general']['extension'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'extension',
                'value' => $extension
            ));

if (isset($_post['telephone'])){
$telephone = $_post['telephone'];
} elseif (isset($_session['guest']['telephone'])){
$telephone = $_session['guest']['telephone'];
} else{
$telephone = '';
}

$this->data['form']['fields']['general']['telephone'] = $form->getFieldHtml(
array (
'type'  => 'input',
'name'  => 'telephone',
'value' => $telephone
));
--- End code ---

abolabo:
did you tried to load language block?
i mean $this->load->language('checkout/guest_step_1);

shahiran12395:
I did try adding the language but still not showing the input label. am i missing something?

i have upload screenshot of the guest checkout form for other to refer below


--- Code: ---$this->load->language('checkout/guest_step_1');

$form = new AForm();
$form->setForm(array ('form_name' => 'guestFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(
array (
                    'type'   => 'form',
                    'name'   => 'guestFrm',
                    'action' => $this->html->getSecureURL('checkout/guest_step_1'),
                    'csrf' => true
                )
        );

if (isset($_post['firstname'])){
$firstname = $_post['firstname'];
} elseif (isset($_session['guest']['firstname'])){
$firstname = $_session['guest']['firstname'];
} else{
$firstname = '';
}

$this->data['form']['fields']['general']['firstname'] = $form->getFieldHtml(array (
'type'     => 'input',
'name'     => 'firstname',
'value'    => $firstname,
'required' => true));


if (isset($_post['lastname'])){
$lastname = $_post['lastname'];
} elseif (isset($_session['guest']['lastname'])){
$lastname = $_session['guest']['lastname'];
} else{
$lastname = '';
}
$this->data['form']['fields']['general']['lastname'] = $form->getFieldHtml(
array (
'type'     => 'input',
'name'     => 'lastname',
'value'    => $lastname,
'required' => true));
if (isset($_post['email'])){
$email = $_post['email'];
} elseif (isset($_session['guest']['email'])){
$email = $_session['guest']['email'];
} else{
$email = '';
}

$this->data['form']['fields']['general']['email'] = $form->getFieldHtml(
array (
'type'     => 'input',
'name'     => 'email',
'value'    => $email,
'required' => true));
        if (isset($_post['phone_code'])){
            $phone_code = $_post['phone_code'];
        } elseif (isset($_session['guest']['phone_code'])){
            $phone_code = $_session['guest']['phone_code'];
        } else{
            $phone_code = '';
        }
        $this->data['form']['fields']['general']['phone_code'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'phone_code',
                'value' => $phone_code
            ));

if (isset($_post['telephone'])){
$telephone = $_post['telephone'];
} elseif (isset($_session['guest']['telephone'])){
$telephone = $_session['guest']['telephone'];
} else{
$telephone = '';
}
$this->data['form']['fields']['general']['telephone'] = $form->getFieldHtml(
array (
'type'  => 'input',
'name'  => 'telephone',
'value' => $telephone
));
--- End code ---


--- Code: ---<definition>
<key>entry_firstname</key>
<value><![CDATA[First Name:]]></value>
</definition>
<definition>
<key>entry_lastname</key>
<value><![CDATA[Last Name:]]></value>
</definition>
<definition>
<key>entry_email</key>
<value><![CDATA[E-Mail:]]></value>
</definition>
<definition>
<key>entry_phone_code</key>
<value><![CDATA[Phone Code:]]></value>
</definition>
<definition>
<key>entry_telephone</key>
<value><![CDATA[Telephone:]]></value>
</definition>
--- End code ---

Navigation

[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod