Primeiramente você deve abrir o arquivo:
app/design/frontend/default/seutema/customer/widget/taxvat.phtml
No início do arquivo insira o seguinte conteúdo:
<?php
//Este bloco de script deve ser rodado apenas uma vez. Após a primeira execução, comente-o.
//Ele é responsável pela criação dos campos referentes ao RG no banco de dados.
$setup = new Mage_Eav_Model_Entity_Setup(’core_setup’);
$setup->addAttribute(’customer’, ‘rg’, array(
’label’ => ‘Rg’,
’visible’ => true,
’required’ => false,
’position’ => 1,
));
$setup->addAttribute(’quote’, ‘customer_rg’, array(’type’ => ’static’, ‘visible’ => false));
$setup->addAttribute(’order’, ‘customer_rg’, array(’type’ => ‘varchar’, ‘visible’ => false));
$setup->getConnection()->addColumn(
$setup->getTable(’sales_flat_quote’),
’customer_rg’,
’varchar(255) NULL DEFAULT NULL AFTER `customer_taxvat`’
);
?>
<?php
$rg = $this->getRg();
if (empty($rg)) {
$rg = $this->getCustomer()->getRg();
}
?>
Agora essa parte você deve inserir após o bloco <div class=”input box taxvat”>
<div>
<label for=”<?php echo $this->getFieldId(’rg’)?>”>
<?php echo $this->__(’RG / Insc. Estadual’) ?>
<?php if ($this->isRequired()):?><span>*</span><?php endif ?>
</label>
<input type=”text” id=”<?php echo $this->getFieldId(’rg’)?>” name=”<?php echo $this->getFieldName(’rg’)?>” value=”<?php echo $this->htmlEscape($rg) ?>” <?php echo $this->getFieldParams() ?> />
</div>
Pronto, o campo Rg vai aparecer ao lado do CPF/CNPJ.
Soluções Web, Linux e Windows