Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Campos: RG / CPF / CNPJ
 
PedroTeixeira
Sr. Member
 
Avatar
Total Posts:  136
Joined:  2008-05-28
Brazil
 

Eai pessoal!

Preciso adicionar os campos de RG / CPF / CNPJ no cadastro do cliente, acredito que não seja só eu que precise disso.

Abri 2 tópicos no Magento internacional para ver se resolvemos isso de uma vez por todas.

Alguém já conseguiu alguma coisa nesse sentido?

Abraços!

 
Magento Community Magento Community
Magento Community
Magento Community
 
APEofGOD
Sr. Member
 
Avatar
Total Posts:  100
Joined:  2008-05-28
 

Cara, o campo CPF/CNPJ de certa forma já existe, é o campo Tax/VAT number, pra que criar outro campo? É só traduzir para CPF/CNPJ na tradução para PT_BR. O mesmo se pode dizer para o campo CEP, que já existe o campo Zip Code que pode perfeitamente ser traduzido para PT_BR como CEP. Ou seja, não é preciso reinventar a roda.

Já quanto o campo RG, pode-se criar seguindo esse post aqui:
http://www.magentocommerce.com/boards/viewthread/9620/

Testei e funcionou bacana.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Helio
Jr. Member
 
Total Posts:  16
Joined:  2008-09-25
 

Caro
Ape

Eu habilitei mesmo sem traduzir, pois ainda não encontrei o local para isto, mas não funciona, não aparece no cadastro do cliente.
Poderias me ajudar nisto,
Grato

 
Magento Community Magento Community
Magento Community
Magento Community
 
APEofGOD
Sr. Member
 
Avatar
Total Posts:  100
Joined:  2008-05-28
 

Vai lá em System -> Configuration , depois vá em Costumer Configuration -> Name and Address Options, e em Show Tax/VAT number selecione Required ou Optional. Com isso o campo Tax/VAT number aparecerá no cadastro de novos usuários, pelo menos aqui aparece.

Agora se você deseja criar um campo personalizado, olha no link que eu passei no meu post anterior. Eu testei e funcionou.

 
Magento Community Magento Community
Magento Community
Magento Community
 
João Vagner
Member
 
Total Posts:  33
Joined:  2008-10-03
 

Tentei aqui, procurei no arquivo Mage_Customer.csv e não achei, basta adicionar o Campo que o magento identifica a tradução?

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

vocês podem usar o in-line translation em system->config->developer

abraços,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bruno Morejon
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2009-06-05
 
andreladocruz - 10 November 2008 06:50 AM

vocês podem usar o in-line translation em system->config->developer

abraços,

Esse Magento me impressiona cada vez mais.

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcelolinhares
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2009-06-23
 

Pessoal,
Estou adicionando alguns atributos na entidade Customer.
Na parte de register / edit funcionou supimpa (Coloquei os campos na tabela EAV_ATRIBUTE e fiz as associações)

No entanto, na parte de checkout, o campo não persiste de jeito nenhum na tabela.

Vi que ele passa pela tabela “sales_flat_quote”, também adicionei as colunas nesta tabela, bem como alterei o config.xml do path: \app\code\core\Mage\Checkout\etc\

<checkout_onepage_billing>
<customer_is_pj><to_customer>is_pj</to_customer></customer_is_pj>

Mas o campo insiste em não gravar.....

alguma sugestão?

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcelolinhares
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2009-06-23
 

Pessoal,
Para conhecimento, consegui customizar os campos na tela de checkout.

Foi necessário além dos passos acima citados customizar no método “_processValidateCustomer “ da classe: “core/Mage/Checkout/Model/Type/Onepage.php”

Adicionando as seguintes condições:

// set customer tax/vat number for further usage
if ($address->getIsPj()) {
$this->getQuote()->setCustomerIsPj($address->getIsPj() );
}

if ($address->getSocialReason()) {
$this->getQuote()->setCustomerSocialReason($address->getSocialReason() );
}

E também tive que adicionar estes campos na tabela “sales_flat_quote”..

 
Magento Community Magento Community
Magento Community
Magento Community
 
danielbarbosa09
Jr. Member
 
Total Posts:  13
Joined:  2010-11-27
 

Estou chegando bem próximo de Resolver o problema. Ocorre que o magento Valida o Javascirpt by id e não pelo nome.

Segue um codigo que achei na internet que valida o cnpj e o cnjp automaticamente.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sem título</title>
</
head>

<
body>


<
script LANGUAGE="javascript">
/*
http://www.vbweb.com.br/dicas_visual.asp?Codigo=1103&Classificacao;=2

/*Este script faz a validação de um CPf ou CNPJ a partir de uma mesma entrada de texto. Ele faz a verificação se o campo Ã© númerico e restringe o tamanho de 11 digitos para CPF e 14 para CNPJ. Ã© importante informar a forma de entrada de dados que deverá ser sem mascara.

Ass. Glaucio Oliveira Magalhães

segue script

*/

<!--
function 
Validar(theCPF)
{
 
var theCPFdocument.getElementById("input");
  if (
theCPF.value == "")
  
{
    alert(
"Campo inválido. Ã‰ necessário informar o CPF ou CNPJ");
    
theCPF.blur();
    return (
false);
  
}
  
if (((theCPF.value.length == 11) && (theCPF.value == 11111111111) || (theCPF.value == 22222222222) || (theCPF.value == 33333333333) || (theCPF.value == 44444444444) || (theCPF.value == 55555555555) || (theCPF.value == 66666666666) || (theCPF.value == 77777777777) || (theCPF.value == 88888888888) || (theCPF.value == 99999999999) || (theCPF.value == 00000000000)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}


  
if (!((theCPF.value.length == 11) || (theCPF.value.length == 14)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}

  
var checkOK "0123456789";
  var 
checkStr theCPF.value;
  var 
allValid true;
  var 
allNum "";
  for (
0;  checkStr.length;  i++)
  
{
    ch 
checkStr.charAt(i);
    for (
0;  checkOK.length;  j++)
      if (
ch == checkOK.charAt(j))
        break;
    if (
== checkOK.length)
    
{
      allValid 
false;
      break;
    
}
    allNum 
+= ch;
  
}
  
if (!allValid)
  
{
    alert(
"Favor preencher somente com dígitos o campo CPF/CNPJ.");
    
theCPF.blur();
    return (
false);
  
}

  
var chkVal allNum;
  var 
prsVal parseFloat(allNum);
  if (
chkVal != "" && !(prsVal "0"))
  
{
    alert(
"CPF zerado !");
    
theCPF.blur();
    return (
false);
  
}

if (theCPF.value.length == 11)
{
  
var tot 0;

  for (
2;  <= 10;  i++)
    
tot += parseInt(checkStr.charAt(10 i));

  if ((
tot 10 11 10) != parseInt(checkStr.charAt(9)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}
  
  tot 
0;
  
  for (
2;  <= 11;  i++)
    
tot += parseInt(checkStr.charAt(11 i));

  if ((
tot 10 11 10) != parseInt(checkStr.charAt(10)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}
}
else
{
  
var tot  0;
  var 
peso 2;
  
  for (
0;  <= 11;  i++)
  
{
    tot 
+= peso parseInt(checkStr.charAt(11 i));
    
peso++;
    if (
peso == 10)
    
{
        peso 
2;
    
}
  }

  
if ((tot 10 11 10) != parseInt(checkStr.charAt(12)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}
  
  tot  
0;
  
peso 2;
  
  for (
0;  <= 12;  i++)
  
{
    tot 
+= peso parseInt(checkStr.charAt(12 i));
    
peso++;
    if (
peso == 10)
    
{
        peso 
2;
    
}
  }

  
if ((tot 10 11 10) != parseInt(checkStr.charAt(13)))
  
{
    alert(
"CPF/CNPJ inválido.");
    
theCPF.blur();
    return (
false);
  
}
}
  
return(true);
}

//-->
</script>

<form name="teste" action="#">
<
input type="text" name="input" id="input" onblur="Validar()" /><br />
<
input name="Enviar" type="submit" value="Enviar" />
</
form>

</
body>
</
html>

Outra coisa as validações desse formulario ficam em:

magento/
js/
prototype/
validation.js

O formulário de registro fica em:
magento/
app/
design/
frontend/
base/
default/
template/
customer/
form/
register.phtml
Este arquivo é que faz o registro.
Caso consiga uma resposta posto aqui, mas estou bem perto.

 
Magento Community Magento Community
Magento Community
Magento Community
 
danielbarbosa09
Jr. Member
 
Total Posts:  13
Joined:  2010-11-27
 

Deem uma olha no arquivo register.phtml que vocês entenderão

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Create account form template
 *
 * @see Mage_Customer_Block_Form_Register
 */
?>
<div class="account-create">
    <
div class="page-title">
        <
h1><?php echo $this->__('Create an Account'?></h1>
    </
div>
    
<?php echo $this->getChildHtml('form_fields_before')?>
    <?php 
echo $this->getMessagesBlock()->getGroupedHtml() ?>
    
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
        <
div class="fieldset">
            <
input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
            <
input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
            <
h2 class="legend"><?php echo $this->__('Personal Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
                
</li>
                <
li>
                    <
label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address'?></label>
                    <
div class="input-box">
                        <
input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
                    </
div>
                </
li>
                
<?php if ($this->isNewsletterEnabled()): ?>
                
<li class="control">
                    <
div class="input-box">
                        <
input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
                    </
div>
                    <
label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter'?></label>
                </
li>
                
<?php endif ?>
            <?php $_dob 
$this->getLayout()->createBlock('customer/widget_dob'?>
            <?php 
if ($_dob->isEnabled()): ?>
                
<li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
            
<?php endif ?>
            <?php $_taxvat 
$this->getLayout()->createBlock('customer/widget_taxvat'?>
            <?php 
if ($_taxvat->isEnabled()): ?>
                
<li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
            
<?php endif ?>
            <?php $_gender 
$this->getLayout()->createBlock('customer/widget_gender'?>
            <?php 
if ($_gender->isEnabled()): ?>
                
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
            
<?php endif ?>
            
</ul>
        </
div>
    
<?php if($this->getShowAddressFields()): ?>
        
<div class="fieldset">
            <
input type="hidden" name="create_address" value="1" />
            <
h2 class="legend"><?php echo $this->__('Address Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    <
div class="field">
                        <
label for="company"><?php echo $this->__('Company'?></label>
                        <
div class="input-box">
                            <
input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone'?></label>
                        <
div class="input-box">
                            <
input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
                        </
div>
                    </
div>
                </
li>
                <
li class="wide">
                    <
label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address'?></label>
                    <
div class="input-box">
                        <
input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
                    </
div>
                </
li>
            
<?php for ($_i=2$_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n$_i++): ?>
                
<li class="wide">
                    <
div class="input-box">
                        <
input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i?>class="input-text" />
                    </
div>
                </
li>
            
<?php endfor ?>
                
<li class="fields">
                    <
div class="field">
                        <
label for="city" class="required"><em>*</em><?php echo $this->__('City'?></label>
                        <
div class="input-box">
                            <
input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province'?></label>
                        <
div class="input-box">
                            <
select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
                                <
option value=""><?php echo $this->__('Please select region, state or province'?></option>
                            </
select>
                            <
script type="text/javascript">
                            
//<![CDATA[
                                
$('region_id').setAttribute('defaultValue'"<?php echo $this->getFormData()->getRegionId() ?>");
                            
//]]>
                            
</script>
                            
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
                        </
div>
                    </
div>
                </
li>
                <
li class="fields">
                    <
div class="field">
                        <
label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code'?></label>
                        <
div class="input-box">
                            <
input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="country" class="required"><em>*</em><?php echo $this->__('Country'?></label>
                        <
div class="input-box">
                            
<?php echo $this->getCountryHtmlSelect() ?>
                        
</div>
                    </
div>
                </
li>
            </
ul>
            <
input type="hidden" name="default_billing" value="1" />
            <
input type="hidden" name="default_shipping" value="1" />
        </
div>
    
<?php endif; ?>
        
<div class="fieldset">
            <
h2 class="legend"><?php echo $this->__('Login Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    <
div class="field">
                        <
label for="password" class="required"><em>*</em><?php echo $this->__('Password'?></label>
                        <
div class="input-box">
                            <
input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password'?></label>
                        <
div class="input-box">
                            <
input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
                        </
div>
                    </
div>
                </
li>
            </
ul>
        </
div>
        <
div class="buttons-set">
            <
class="required"><?php echo $this->__('* Required Fields'?></p>
            <
class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back'?></a></p>
            <
button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit'?></span></span></button>
        </
div>
    </
form>
    <
script type="text/javascript">
    
//<![CDATA[
        
var dataForm = new VarienForm('form-validate'true);
        
<?php if($this->getShowAddressFields()): ?>
        
new RegionUpdater('country''region''region_id'<?php echo $this->helper('directory')->getRegionJson() ?>undefined'zip');
        
<?php endif; ?>
    
//]]>
    
</script>
</div>

Versão 1.4

 
Magento Community Magento Community
Magento Community
Magento Community
 
danielbarbosa09
Jr. Member
 
Total Posts:  13
Joined:  2010-11-27
 

Deem uma olha no arquivo register.phtml que vocês entenderão

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Create account form template
 *
 * @see Mage_Customer_Block_Form_Register
 */
?>
<div class="account-create">
    <
div class="page-title">
        <
h1><?php echo $this->__('Create an Account'?></h1>
    </
div>
    
<?php echo $this->getChildHtml('form_fields_before')?>
    <?php 
echo $this->getMessagesBlock()->getGroupedHtml() ?>
    
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
        <
div class="fieldset">
            <
input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
            <
input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
            <
h2 class="legend"><?php echo $this->__('Personal Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
                
</li>
                <
li>
                    <
label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address'?></label>
                    <
div class="input-box">
                        <
input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
                    </
div>
                </
li>
                
<?php if ($this->isNewsletterEnabled()): ?>
                
<li class="control">
                    <
div class="input-box">
                        <
input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
                    </
div>
                    <
label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter'?></label>
                </
li>
                
<?php endif ?>
            <?php $_dob 
$this->getLayout()->createBlock('customer/widget_dob'?>
            <?php 
if ($_dob->isEnabled()): ?>
                
<li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
            
<?php endif ?>
            <?php $_taxvat 
$this->getLayout()->createBlock('customer/widget_taxvat'?>
            <?php 
if ($_taxvat->isEnabled()): ?>
                
<li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
            
<?php endif ?>
            <?php $_gender 
$this->getLayout()->createBlock('customer/widget_gender'?>
            <?php 
if ($_gender->isEnabled()): ?>
                
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
            
<?php endif ?>
            
</ul>
        </
div>
    
<?php if($this->getShowAddressFields()): ?>
        
<div class="fieldset">
            <
input type="hidden" name="create_address" value="1" />
            <
h2 class="legend"><?php echo $this->__('Address Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    <
div class="field">
                        <
label for="company"><?php echo $this->__('Company'?></label>
                        <
div class="input-box">
                            <
input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone'?></label>
                        <
div class="input-box">
                            <
input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
                        </
div>
                    </
div>
                </
li>
                <
li class="wide">
                    <
label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address'?></label>
                    <
div class="input-box">
                        <
input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
                    </
div>
                </
li>
            
<?php for ($_i=2$_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n$_i++): ?>
                
<li class="wide">
                    <
div class="input-box">
                        <
input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i?>class="input-text" />
                    </
div>
                </
li>
            
<?php endfor ?>
                
<li class="fields">
                    <
div class="field">
                        <
label for="city" class="required"><em>*</em><?php echo $this->__('City'?></label>
                        <
div class="input-box">
                            <
input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province'?></label>
                        <
div class="input-box">
                            <
select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
                                <
option value=""><?php echo $this->__('Please select region, state or province'?></option>
                            </
select>
                            <
script type="text/javascript">
                            
//<![CDATA[
                                
$('region_id').setAttribute('defaultValue'"<?php echo $this->getFormData()->getRegionId() ?>");
                            
//]]>
                            
</script>
                            
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
                        </
div>
                    </
div>
                </
li>
                <
li class="fields">
                    <
div class="field">
                        <
label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code'?></label>
                        <
div class="input-box">
                            <
input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="country" class="required"><em>*</em><?php echo $this->__('Country'?></label>
                        <
div class="input-box">
                            
<?php echo $this->getCountryHtmlSelect() ?>
                        
</div>
                    </
div>
                </
li>
            </
ul>
            <
input type="hidden" name="default_billing" value="1" />
            <
input type="hidden" name="default_shipping" value="1" />
        </
div>
    
<?php endif; ?>
        
<div class="fieldset">
            <
h2 class="legend"><?php echo $this->__('Login Information'?></h2>
            <
ul class="form-list">
                <
li class="fields">
                    <
div class="field">
                        <
label for="password" class="required"><em>*</em><?php echo $this->__('Password'?></label>
                        <
div class="input-box">
                            <
input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
                        </
div>
                    </
div>
                    <
div class="field">
                        <
label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password'?></label>
                        <
div class="input-box">
                            <
input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
                        </
div>
                    </
div>
                </
li>
            </
ul>
        </
div>
        <
div class="buttons-set">
            <
class="required"><?php echo $this->__('* Required Fields'?></p>
            <
class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back'?></a></p>
            <
button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit'?></span></span></button>
        </
div>
    </
form>
    <
script type="text/javascript">
    
//<![CDATA[
        
var dataForm = new VarienForm('form-validate'true);
        
<?php if($this->getShowAddressFields()): ?>
        
new RegionUpdater('country''region''region_id'<?php echo $this->helper('directory')->getRegionJson() ?>undefined'zip');
        
<?php endif; ?>
    
//]]>
    
</script>
</div>

Versão 1.4

 
Magento Community Magento Community
Magento Community
Magento Community
 
danielbarbosa09
Jr. Member
 
Total Posts:  13
Joined:  2010-11-27
 

Veja o trecho que tem que ser alterado no arquivo taxvat.phtml

class="required

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<label for="<?php echo $this->getFieldId('taxvat')?>"<?php if ($this->isRequired()) echo ' class="required"' ?>><?php if ($this->isRequired()) echo '<em>*</em>' ?><?php echo $this->__('Tax/VAT number'?></label>
<
div class="input-box">
    <
input type="text" id="<?php echo $this->getFieldId('taxvat')?>" name="<?php echo $this->getFieldName('taxvat')?>" value="<?php echo $this->htmlEscape($this->getTaxvat()) ?>" title="<?php echo $this->__('Tax/VAT number') ?>" class="input-text<?php if ($this->isRequired()):?> required-entry<?php endif; ?>" <?php echo $this->getFieldParams() ?> />
</
div>
 
Magento Community Magento Community
Magento Community
Magento Community
 
danielbarbosa09
Jr. Member
 
Total Posts:  13
Joined:  2010-11-27
 

DEPOIS DE MUITO PESQUISAR ENCONTREI A SOLUÇÃO DEFINITIVA PARA A QUESTÃO DO CPF E CNPJ.

GUIA DE IMPLEMENTACAO CPF CNPJ

 
Magento Community Magento Community
Magento Community
Magento Community
 
angelicakm
Jr. Member
 
Total Posts:  27
Joined:  2011-03-29
 

tem mais um problema.....

como a gente faz para validar o cpf e o cnpj com o dígito verificador???
alguém faz a mais vaga idéia?

para isso, não dá pra usar o campo pré-formatado tax/vat do magento, e agora, com a nota fiscal eletrônica, não pode ter risco de o cliente digitar estes números errados, precisa validar senão a gente não consegue emitir as notas pra SEFAZ..

se alguém puder colaborar neste tópico…

 
Magento Community Magento Community
Magento Community
Magento Community
 
adolfoneto.for@hotmail.com
Jr. Member
 
Total Posts:  4
Joined:  2010-05-14
 

COLOQUEI ESSA REFERENCIA NA COMUNIDADE MAGENTO, MAS FOI REMOVIDA 3 VEZES PESSOAL E AINDA DESABILITARAM MINHA CONTA.
MAS NÃO TEM PROBLEMA, AQUI ELES NÃO PODEM REMOVER ESSE POST, PENSEM SOBRE ISSO.

AQUI VAI UM BLOG EXCELENTE QUE TEM MUITAS DICAS PARA SUAS LOJAS VIRTUAIS:

http://www.webgp.com.br/index.php/blog/2011/04/magento-modulo-free-para-inclusao-de-cpf-rg-cnpj-e-etc/

SUCESSO A TODOS. NÃO PRECEISAMOS DE MERCENÁRIOS EM UMA COMUNIDADE OPEN SOURCE.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2