Advertisement
Guest User

Untitled

a guest
Apr 14th, 2014
781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 42.89 KB | None | 0 0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE_AFL.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category    design
  22. * @package     base_default
  23. * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
  24. * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  25. */
  26. ?>
  27. <h1><?php echo $this->__('Billing Address');?></h1>
  28. <form id="co-billing-form" action="">
  29.     <fieldset>
  30.         <ul class="form-list">
  31.             <?php if ($this->customerHasAddresses()): ?>
  32.                 <li class="wide">
  33.                     <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
  34.                     <div class="input-box">
  35.                         <?php echo $this->getAddressesHtmlSelect('billing') ?>
  36.                     </div>
  37.                 </li>
  38.             <?php endif; ?>
  39.             <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
  40.                 <fieldset>
  41.                     <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
  42.                     <ul>
  43.                         <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
  44.                         <li class="fields">
  45.                             <div class="field">
  46.                                 <label for="billing:company"><?php echo $this->__('Company') ?></label>
  47.                                 <div class="input-box">
  48.                                     <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
  49.                                 </div>
  50.                             </div>
  51.                             <?php if (!$this->isCustomerLoggedIn()): ?>
  52.                                 <div class="field">
  53.                                     <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
  54.                                     <div class="input-box">
  55.                                         <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
  56.                                     </div>
  57.                                 </div>
  58.                             <?php endif ?>
  59.                         </li>
  60.  
  61.                         <?php if (!$this->isCustomerLoggedIn()): ?>
  62.                             <li>
  63.                                 <input type="radio" name="billing[tipopessoa]" id="billing:pf" value="pf" checked="checked"  title="Pessoa F&iacute;sica" onclick="$('dados01').style.display = 'none';
  64.                            $('billing:cnpj').removeClassName('validar_cnpj');
  65.                            $('billing:razaosocial').removeClassName('required-entry');
  66.                            $('dados02').style.display = 'block';
  67.                            $('billing:cpf').addClassName('required-entry');
  68.                            $('cnpj').addClassName('required-entry');" class="radio" />&nbsp;&nbsp;Pessoa F&iacute;sica
  69.                                 <input type="radio" name="billing[tipopessoa]" id="billing:pj" value="pj" title="Pessoa Jur&iacute;dica" onclick="$('dados01').style.display = 'block';
  70.                            $('dados02').style.display = 'none';
  71.                            $('billing:cpf').removeClassName('required-entry');
  72.                            $('billing:rg').removeClassName('required-entry');
  73.                            $('billing:cnpj').addClassName('validar_cnpj');
  74.                            $('billing:razaosocial').addClassName('required-entry');" class="radio">&nbsp;&nbsp;Pessoa Jur&iacute;dica
  75.                             </li>
  76.  
  77.                             <div class="fieldset no-display" id="dados01">
  78.                                 <h2 class="legend">Dados da Empresa - Cliente de Atacado</h4>
  79.                                     <h5>Preencha os dados da empresa somente para compras como cliente corporativo</h5>
  80.                                     <ul class="form-list">
  81.                                         <li class="fields">
  82.                                             <div >
  83.                                                 <div class="field">
  84.                                                     <label for="billing:razaosocial" class="required">Raz&atilde;o Social<em>*</em> </label><br/>
  85.                                                     <div class="input-box">
  86.                                                         <input type="text" name="billing[razaosocial]" id="billing:razaosocial" title="Raz&atilde;o Social" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getRazaosocial()) ?>"  />
  87.                                                     </div>
  88.                                                 </div>
  89.                                             </div>
  90.                                         </li>
  91.                                         <li class="fields">
  92.                                             <div >
  93.                                                 <div class="field">
  94.                                                     <label for="billing:cnpj" class="required">CNPJ<em>*</em> </label><br/>
  95.                                                     <div class="input-box">
  96.                                                         <input type="text" name="billing[cnpj]" id="billing:cnpj" title="CNPJ" class="input-text cnpj" value="<?php echo $this->htmlEscape($this->getAddress()->getCnpj) ?>" />
  97.                                                     </div>
  98.                                                 </div>
  99.                                                 <div class="field">
  100.                                                     <label for="billing:ie">IE </label><br/>
  101.                                                     <div class="input-box">
  102.                                                         <input type="text" name="billing[ie]" id="billing:ie" title="IE"  class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getIe) ?>" />
  103.                                                     </div>
  104.                                                 </div>
  105.                                             </div>
  106.                                         </li>
  107.                                     </ul>
  108.                             </div>
  109.  
  110.                             <div class="fieldset" id="dados02">
  111.                                 <h2 class="legend">Dados da Pessoa F&iacute;sica</h4>
  112.                                     <ul class="form-list">
  113.                                         <li class="fields">
  114.                                             <div >
  115.                                                 <div class="field">
  116.                                                     <label for="billing:rg" class="required">Rg<em>*</em> </label><br/>
  117.                                                     <div class="input-box">
  118.                                                         <input type="text" name="billing[rg]" id="billing:rg" title="Rg" class="input-text required-entry" value="<?php echo $this->htmlEscape($this->getAddress()->getRg()) ?>" />
  119.                                                     </div>
  120.                                                 </div>
  121.                                                 <div class="field">
  122.                                                     <label for="billing:cpf" class="required">Cpf<em>*</em> </label><br/>
  123.                                                     <div class="input-box">
  124.                                                         <input type="text" name="billing[cpf]" id="billing:cpf" title="Cpf" class="input-text required-entry cpf" value="<?php echo $this->htmlEscape($this->getAddress()->getCpf()) ?>" />
  125.                                                     </div>
  126.                                                 </div>
  127.                                             </div>
  128.                                         </li>
  129.                                     </ul>
  130.                             </div>
  131.  
  132.  
  133.                         <?php endif ?>
  134.  
  135.  
  136.  
  137.  
  138.                         <li class="fields">
  139.                             <div class="field">
  140.                                 <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
  141.                                 <div class="input-box">
  142.                                     <input type="text" onblur="buscar_end();" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text mask_postcode required-entry" />
  143.                                 </div>
  144.                                 <div id="load-end-billing" class="input-box"><a href="http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro" target="_blank">n&atilde;o sabe o cep?</a></div>
  145.                             </div>
  146.                             <div class="field" style="display:none;">
  147.                                 <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
  148.                                 <div class="input-box">
  149.                                     <?php echo $this->getCountryHtmlSelect('billing') ?>
  150.                                 </div>
  151.                             </div>
  152.                         </li>
  153.                         <li class="wide">
  154.                             <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
  155.                             <div class="input-box">
  156.                                 <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
  157.                             </div>
  158.                         </li>
  159.                         <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
  160.                             <li class="wide">
  161.                                 <div class="input-box">
  162.                                     <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
  163.                                 </div>
  164.                             </li>
  165.                         <?php endfor ?>
  166.                         <li class="fields">
  167.                             <div class="field">
  168.                                <label for="billing:numero_end" class="required"><em>*</em><?php echo $this->__('Numero') ?></label>
  169.                                <div class="input-box">
  170.                                    <input type="text" title="<?php echo $this->__('Numero') ?>" name="billing[numero_end]" value="<?php echo $this->htmlEscape($this->getAddress()->getNumero_end()) ?>" class="input-text required-entry" id="billing:numero_end" />
  171.                                </div>
  172.                            </div>
  173.                             <div class="field">
  174.                                <label for="billing:complemento_end"><?php echo $this->__('Complemento') ?></label>
  175.                                <div class="input-box">
  176.                                    <input type="text" title="<?php echo $this->__('Complemento') ?>" name="billing[complemento_end]" value="<?php echo $this->htmlEscape($this->getAddress()->getComplemento_end()) ?>" class="input-text" id="billing:complemento_end" />
  177.                                </div>
  178.                            </div>
  179.                         </li>
  180.                         <li class="fields">
  181.                             <div class="field">
  182.                                 <label for="billing:bairro" class="required"><em>*</em><?php echo $this->__('Bairro') ?></label>
  183.                                 <div class="input-box">
  184.                                     <input type="text" title="<?php echo $this->__('Bairro') ?>" name="billing[bairro]" value="" class="input-text required-entry" id="billing:bairro" />
  185.                                 </div>
  186.                             </div>
  187.                          </li>
  188.                            
  189.                         <li class="fields">
  190.                             <div class="field">
  191.                                 <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
  192.                                 <div class="input-box">
  193.                                     <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
  194.                                 </div>
  195.                             </div>
  196.                             <div class="field">
  197.                                 <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
  198.                                 <div class="input-box">
  199.                                     <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select">
  200.                                             <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
  201.                                     </select>
  202.                                     <script type="text/javascript">
  203.                                         //<![CDATA[
  204.                                        $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
  205.                                        //]]>
  206.                                     </script>
  207.                                     <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>"  title="<?php echo $this->__('State/Province') ?>" class="input-text"  />
  208.                                 </div>
  209.                             </div>
  210.                         </li>
  211.                         <li class="fields">
  212.                             <div class="field">
  213.                                 <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
  214.                                 <div class="input-box">
  215.                                     <input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry mask_tel" id="billing:telephone" />
  216.                                 </div>
  217.                             </div>
  218.                             <div class="field">
  219.                                 <label for="billing:fax"><?php echo $this->__('Celular') ?></label>
  220.                                 <div class="input-box">
  221.                                     <input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text mask_tel" id="billing:fax" />
  222.                                 </div>
  223.                             </div>
  224.                         </li>
  225.                         <?php if (!$this->isCustomerLoggedIn()): ?>
  226.  
  227.                             <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
  228.                             <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
  229.                             <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
  230.                                 <li class="fields">
  231.                                     <?php if ($_dob->isEnabled()): ?>
  232.                                         <div class="field">
  233.                                             <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
  234.                                         </div>
  235.                                     <?php endif; ?>
  236.                                     <?php if ($_gender->isEnabled()): ?>
  237.                                         <div class="field">
  238.                                             <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
  239.                                         </div>
  240.                                     <?php endif ?>
  241.                                 </li>
  242.                             <?php endif ?>
  243.  
  244.                             <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
  245.                             <?php if ($_taxvat->isEnabled()): ?>
  246.                                 <li>
  247.                                     <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
  248.                                 </li>
  249.                             <?php endif ?>
  250.  
  251.                             <li class="fields" id="register-customer-password">
  252.                                 <div class="field">
  253.                                     <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
  254.                                     <div class="input-box">
  255.                                         <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
  256.                                     </div>
  257.                                 </div>
  258.                                 <div class="field">
  259.                                     <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
  260.                                     <div class="input-box">
  261.                                         <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
  262.                                     </div>
  263.                                 </div>
  264.                             </li>
  265.                         <?php endif; ?>
  266.                         <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()): ?>
  267.                            <li class="control">
  268.                                <input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
  269.                             </li>
  270.                         <?php else: ?>
  271.                             <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
  272.                         <?php endif; ?>
  273.                     </ul>
  274.                 </fieldset>
  275.             </li>
  276.         </ul>
  277.         <?php if (!$this->canShip()): ?>
  278.             <input type="hidden" name="billing[use_for_shipping]" value="1" />
  279.         <?php endif; ?>
  280.     </fieldset>
  281. </form>
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289. <h1><?php echo $this->__('Shipping Address');?></h1>
  290. <?php if ($this->canShip()): ?>
  291.     <ul class="form-list">
  292.         <li class="control">
  293.             <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) { ?> checked="checked"<?php } ?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio sameaddress" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
  294.         <li class="control">
  295.             <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) { ?> checked="checked"<?php } ?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
  296.         </li>
  297.     </ul>
  298. <?php endif; ?>
  299. <div id="shipping_address_change">
  300. <form action="" id="co-shipping-form">
  301.     <ul class="form-list">
  302.     <?php if ($this->customerHasAddresses()): ?>
  303.        <li class="wide">
  304.            <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
  305.            <div class="input-box">
  306.                <?php echo $this->getAddressesHtmlSelect('shipping') ?>
  307.            </div>
  308.        </li>
  309.     <?php endif ?>
  310.         <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
  311.             <fieldset>
  312.                 <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
  313.                 <ul>
  314.                     <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
  315.                     <li class="fields">
  316.                         <div class="fields">
  317.                             <label for="shipping:company"><?php echo $this->__('Company') ?></label>
  318.                             <div class="input-box">
  319.                                 <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" onchange="shipping.setSameAsBilling(false);" />
  320.                             </div>
  321.                         </div>
  322.                     </li>
  323.                    
  324.                     <li class="fields">
  325.                         <div class="field">
  326.                             <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
  327.                             <div class="input-box">
  328.                                 <input type="text" onblur="buscar_end2();" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text mask_postcode required-entry" />
  329.                             </div>
  330.                             <div id="load-end-shipping" class="input-box"><a href="http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro" target="_blank">n&atilde;o sabe o cep?</a></div>
  331.                         </div>
  332.                         <div class="field" style="display:none;">
  333.                             <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
  334.                             <div class="input-box">
  335.                                 <?php echo $this->getCountryHtmlSelect('shipping') ?>
  336.                             </div>
  337.                         </div>
  338.                     </li>
  339.                    
  340.             <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
  341.                     <li class="wide">
  342.                         <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
  343.                         <div class="input-box">
  344.                             <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
  345.                         </div>
  346.                     </li>
  347.             <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
  348.             <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
  349.                     <li class="wide">
  350.                         <div class="input-box">
  351.                             <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
  352.                         </div>
  353.                     </li>
  354.             <?php endfor; ?>
  355.                     <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
  356.                     <li class="wide">
  357.                         <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
  358.                         <div class="input-box">
  359.                             <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
  360.                         </div>
  361.                     </li>
  362.                     <?php endif; ?>
  363.                    
  364.                    
  365.                     <li class="fields">
  366.                         <div class="field">
  367.                            <label for="shipping:numero_end" class="required"><em>*</em><?php echo $this->__('Numero') ?></label>
  368.                            <div class="input-box">
  369.                                <input type="text" title="<?php echo $this->__('Numero') ?>" name="shipping[numero_end]" value="" class="input-text required-entry" id="shipping:numero_end" />
  370.                            </div>
  371.                        </div>
  372.                         <div class="field">
  373.                            <label for="shipping:complemento_end"><?php echo $this->__('Complemento') ?></label>
  374.                            <div class="input-box">
  375.                                <input type="text" title="<?php echo $this->__('Complemento') ?>" name="shipping[complemento_end]" value="" class="input-text" id="shipping:complemento_end" />
  376.                            </div>
  377.                        </div>
  378.                     </li>
  379.                    
  380.                     <li class="fields">
  381.                        <div class="field">
  382.                            <label for="shipping:bairro" class="required"><em>*</em><?php echo $this->__('Bairro') ?></label>
  383.                            <div class="input-box">
  384.                                <input type="text" title="<?php echo $this->__('Bairro') ?>" name="shipping[bairro]" value="" class="input-text required-entry" id="shipping:bairro" />
  385.                            </div>
  386.                        </div>
  387.                     </li>
  388.                    
  389.                     <li class="fields">
  390.                         <div class="field">
  391.                             <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
  392.                             <div class="input-box">
  393.                                 <input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
  394.                             </div>
  395.                         </div>
  396.                         <div class="field">
  397.                             <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
  398.                             <div class="input-box">
  399.                                 <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
  400.                                     <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
  401.                                 </select>
  402.                                 <script type="text/javascript">
  403.                                 //<![CDATA[
  404.                                    $('shipping:region_id').setAttribute('defaultValue',  "<?php echo $this->getAddress()->getRegionId() ?>");
  405.                                //]]>
  406.                                 </script>
  407.                                 <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
  408.                             </div>
  409.                         </div>
  410.                     </li>
  411.                     <li class="fields">
  412.                         <div class="field">
  413.                             <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
  414.                             <div class="input-box">
  415.                                 <input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text mask_tel <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
  416.                             </div>
  417.                         </div>
  418.                         <div class="field">
  419.                             <label for="shipping:fax"><?php echo $this->__('Celular') ?></label>
  420.                             <div class="input-box">
  421.                                 <input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text mask_tel <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
  422.                             </div>
  423.                         </div>
  424.                     </li>
  425.                 <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
  426.                    <li class="control">
  427.                        <input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
  428.                 <?php else:?>
  429.                     <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
  430.                 <?php endif;?>
  431.                 </ul>
  432.             </fieldset>
  433.         </li>
  434.         <li class="control no-display">
  435.             <input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> title="<?php echo $this->__('Use Billing Address') ?>" onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" /><label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
  436.         </li>
  437.     </ul>
  438. </form>
  439. </div>
  440.  
  441. <h1><?php echo $this->__('Escolha o Modo de Envio');?></h1>
  442. <form id="co-shipping-method-form" action="">
  443.     <div id="checkout-shipping-method-load">
  444.         <?php echo $this->getChildHtml('available') ?>
  445.     </div>
  446.     <script type="text/javascript">
  447.     //<![CDATA[
  448.        var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('checkout/onepage/saveShippingMethod') ?>");
  449.    //]]>
  450.     </script>
  451.     <div id="onepage-checkout-shipping-method-additional-load">
  452.         <?php echo $this->getChildHtml('additional') ?>
  453.     </div>
  454. </form>
  455.  
  456.  
  457. <div id="billing-buttons-container">
  458.     <p class="required"><?php echo $this->__('* Required Fields') ?></p>
  459.     <button type="button" class="btn-checkout_4on" title="<?php echo $this->__('Continue') ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
  460.    
  461.     <div class="clear"></div>
  462.  
  463.     <div class="grid_12 alpha">
  464.         <button type="button" class="btn-checkout-back_4on" onclick="window.location = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>checkout/cart/';"><span><span><?php echo $this->__('Back') ?></span></span></button>
  465.     </div>
  466.    
  467.     <div class="grid_12 a-right omega">
  468.         <button type="button" class="btn-checkout_4on btn-setStep" onclick="shippingMethod.save();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
  469.         <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
  470.             <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
  471.         </span>
  472.     </div>
  473.     <div class="clear"></div>
  474. </div>
  475.  
  476.  
  477.  
  478. <script type="text/javascript">
  479. //<![CDATA[
  480.    var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
  481.    var billingForm = new VarienForm('co-billing-form');
  482.  
  483.    billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
  484.    $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
  485.  
  486.    var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
  487.    var countryRegions = <?php echo $this->helper('directory')->getRegionJson(); ?>;
  488.    if ($('onepage-guest-register-button')) {
  489.        Event.observe($('onepage-guest-register-button'), 'click', function(event) {
  490.            var billingRememberMe = $('co-billing-form').select('#remember-me-box');
  491.            if (billingRememberMe.length > 0) {
  492.                if ($('login:guest') && $('login:guest').checked) {
  493.                    billingRememberMe[0].hide();
  494.                } else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
  495.                    billingRememberMe[0].show();
  496.                }
  497.            }
  498.        });
  499.    }
  500.  
  501. //]]>
  502. </script>
  503.  
  504. <!--<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/prototype.maskedinput.js') ?>"></script>-->
  505. <!--<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/validaCPFCNPJ.js'); ?>"></script> -->
  506. <script type="text/javascript">
  507. //<![CDATA[
  508.    Event.observe(window, 'load', function() {
  509.        /*new mask(".cpf", '999.999.999-99');
  510.        new mask(".cnpj", '99.999.999/9999-99');
  511.        new mask(".mask_postcode", '99999-999');*/
  512.        jQuery('.cpf').mask('999.999.999-99');
  513.        jQuery('.cnpj').mask('99.999.999/9999-99');
  514.        jQuery('.mask_postcode').mask('99999-999');
  515.        
  516.        
  517.        jQuery('.mask_tel').mask("(99) 9999-9999?9").ready(function(event) {
  518.            var target, phone, element;
  519.            target = (event.currentTarget) ? event.currentTarget : event.srcElement;
  520.            phone = target.value.replace(/\D/g, '');
  521.            element = $(target);
  522.            element.unmask();
  523.            if(phone.length > 10) {
  524.                element.mask("(99) 99999-999?9");
  525.            } else {
  526.                element.mask("(99) 9999-9999?9");  
  527.            }
  528.    });
  529. });
  530. //]]>
  531. </script>
  532.  
  533. <script type="text/javascript">
  534. //<![CDATA[
  535.    jQuery("#shipping_address_change").addClass("no-display");
  536.    function vEntrega(){
  537.        
  538.        //jQuery(".control:eq(1)").remove();
  539.        if(jQuery(".sameaddress").is(':checked')){
  540.            jQuery("#shipping_address_change").addClass("no-display");
  541.        }else{
  542.            jQuery("#shipping_address_change").removeClass("no-display");
  543.        }
  544.    }
  545.    jQuery(".control input").change(function(){vEntrega();});
  546.    vEntrega();
  547.    /*jQuery(function ($){
  548.        function vEntrega(){
  549.                if($("#billing:use_for_shipping_yes").isChecked())
  550.                    $("#shipping_address_change").removeClass("no-display");
  551.                else
  552.                    $("#shipping_address_change").addClass("no-display");
  553.        }
  554.        vEntrega();
  555.        /*$(".control #billing:use_for_shipping_yes, .control #billing:use_for_shipping_no").click(function(){
  556.            alert("teste");
  557.        });
  558.        
  559.    });
  560.    jQuery("#shipping:same_as_billing").change(function() {
  561.            alert("teste");
  562.        });*/
  563.    function fireEvent(element, event) {
  564.        if (document.createEvent) {
  565.            // dispatch for firefox + others
  566.            var evt = document.createEvent("HTMLEvents");
  567.            evt.initEvent(event, true, true); // event type,bubbling,cancelable
  568.            return !element.dispatchEvent(evt);
  569.        } else {
  570.            // dispatch for IE
  571.            var evt = document.createEventObject();
  572.            return element.fireEvent('on' + event, evt)
  573.        }
  574.    }
  575.  
  576.    function buscar_end() {
  577.        local = "billing";
  578.        $(local + ':street1').value = '';
  579.        if ($(local + ':street2'))
  580.            $(local + ':street2').value = '';
  581.        if ($(local + ':street3'))
  582.            $(local + ':street3').value = '';
  583.        if ($(local + ':street4'))
  584.            $(local + ':street4').value = '';
  585.        if ($(local + ':region'))
  586.            $(local + ':region').value = '';
  587.        if ($(local + ': city'))
  588.            $(local + ':city').value = '';
  589.        if ($(local + ':region_id')){
  590.            $(local + ':region_id').value = '';
  591.        }if ($(local + ':bairro'))
  592.            $(local + ':bairro').value = '';
  593.        if ($(local + ':numero_end'))
  594.            $(local + ':numero_end').value = '';
  595.        if ($(local + ':complemento_end'))
  596.            $(local + ':complemento_end').value = '';
  597.  
  598.        var urlAjax = location.href;
  599.        var validarUrl = /^https:\/\//;
  600.  
  601.        if (urlAjax.match(validarUrl)) {
  602.            urlAjax = '<?php echo Mage::getBaseUrl("link", true) . "ajaxend/ajax" ?>';
  603.        } else {
  604.            urlAjax = '<?php echo $this->getUrl("ajaxend/ajax") ?>';
  605.        }
  606.  
  607.        new Ajax.Request(urlAjax, {method: 'POST',
  608.            parameters: 'cep=' + $(local + ':postcode').value,
  609.            evalScripts: true,
  610.            onLoading: function(transport) {
  611.                $('load-end-' + local).innerHTML = '<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" /> <span style="color: #888;">Carregando...</span>';
  612.            },
  613.            onComplete: function(transport) {
  614.                $('load-end-' + local).innerHTML = '<a href="http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro" target="_blank">n&atilde;o sabe o cep?</a>';
  615.            },
  616.            onSuccess: function(transport) {
  617.                if (200 == transport.status) {
  618.                    try {
  619.                        var res = transport.responseText.evalJSON();
  620.  
  621.                        if (res.resultado > 0) {
  622.                            $(local + ':street1').value = res.tipo_logradouro + ' ' + res.logradouro;
  623.                            if ($(local + ':bairro'))
  624.                                $(local + ':bairro').value = res.bairro;
  625.                            //if ($(local + ':street2'))
  626.                            //    $(local + ':street2').value = res.bairro;
  627.                            $(local + ':city').value = res.cidade;
  628.                            if ($(local + ':region'))
  629.                                $(local + ':region').value = res.uf;
  630.                            if ($(local + ':region_id')) {
  631.                                for (var obj in countryRegions['BR']) {
  632.                                    if (res.uf == countryRegions['BR'][obj].code) {
  633.                                        $(local + ':region_id').value = obj;
  634.                                    }
  635.                                }
  636.                            }
  637.                            fireEvent($(local + ':postcode'), 'change');
  638.                        }
  639.                    } catch (e) {
  640.                        alert( e.message );
  641.                    }
  642.                } else {
  643.                   alert( transport );
  644.                }
  645.            },
  646.            onFailure: function() { document.getElementById("...").innerHTML = 'problemas...';}
  647.        });
  648.    }
  649. //]]>
  650.     Validation.add('validar_cpf', 'O CPF informado \xE9 invalido', function(v) {
  651.         return validaCPF(v, 0);
  652.     });
  653.     Validation.add('validar_cnpj', 'O CNPJ informado \xE9 invalido', function(v) {
  654.         return validaCPF(v, 0);
  655.     });
  656. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement