Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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)
- */
- ?>
- <h1><?php echo $this->__('Billing Address');?></h1>
- <form id="co-billing-form" action="">
- <fieldset>
- <ul class="form-list">
- <?php if ($this->customerHasAddresses()): ?>
- <li class="wide">
- <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
- <div class="input-box">
- <?php echo $this->getAddressesHtmlSelect('billing') ?>
- </div>
- </li>
- <?php endif; ?>
- <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
- <fieldset>
- <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
- <ul>
- <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
- <li class="fields">
- <div class="field">
- <label for="billing:company"><?php echo $this->__('Company') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- <?php if (!$this->isCustomerLoggedIn()): ?>
- <div class="field">
- <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- <?php endif ?>
- </li>
- <?php if (!$this->isCustomerLoggedIn()): ?>
- <li>
- <input type="radio" name="billing[tipopessoa]" id="billing:pf" value="pf" checked="checked" title="Pessoa Física" onclick="$('dados01').style.display = 'none';
- $('billing:cnpj').removeClassName('validar_cnpj');
- $('billing:razaosocial').removeClassName('required-entry');
- $('dados02').style.display = 'block';
- $('billing:cpf').addClassName('required-entry');
- $('cnpj').addClassName('required-entry');" class="radio" /> Pessoa Física
- <input type="radio" name="billing[tipopessoa]" id="billing:pj" value="pj" title="Pessoa Jurídica" onclick="$('dados01').style.display = 'block';
- $('dados02').style.display = 'none';
- $('billing:cpf').removeClassName('required-entry');
- $('billing:rg').removeClassName('required-entry');
- $('billing:cnpj').addClassName('validar_cnpj');
- $('billing:razaosocial').addClassName('required-entry');" class="radio"> Pessoa Jurídica
- </li>
- <div class="fieldset no-display" id="dados01">
- <h2 class="legend">Dados da Empresa - Cliente de Atacado</h4>
- <h5>Preencha os dados da empresa somente para compras como cliente corporativo</h5>
- <ul class="form-list">
- <li class="fields">
- <div >
- <div class="field">
- <label for="billing:razaosocial" class="required">Razão Social<em>*</em> </label><br/>
- <div class="input-box">
- <input type="text" name="billing[razaosocial]" id="billing:razaosocial" title="Razão Social" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getRazaosocial()) ?>" />
- </div>
- </div>
- </div>
- </li>
- <li class="fields">
- <div >
- <div class="field">
- <label for="billing:cnpj" class="required">CNPJ<em>*</em> </label><br/>
- <div class="input-box">
- <input type="text" name="billing[cnpj]" id="billing:cnpj" title="CNPJ" class="input-text cnpj" value="<?php echo $this->htmlEscape($this->getAddress()->getCnpj) ?>" />
- </div>
- </div>
- <div class="field">
- <label for="billing:ie">IE </label><br/>
- <div class="input-box">
- <input type="text" name="billing[ie]" id="billing:ie" title="IE" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getIe) ?>" />
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
- <div class="fieldset" id="dados02">
- <h2 class="legend">Dados da Pessoa Física</h4>
- <ul class="form-list">
- <li class="fields">
- <div >
- <div class="field">
- <label for="billing:rg" class="required">Rg<em>*</em> </label><br/>
- <div class="input-box">
- <input type="text" name="billing[rg]" id="billing:rg" title="Rg" class="input-text required-entry" value="<?php echo $this->htmlEscape($this->getAddress()->getRg()) ?>" />
- </div>
- </div>
- <div class="field">
- <label for="billing:cpf" class="required">Cpf<em>*</em> </label><br/>
- <div class="input-box">
- <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()) ?>" />
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
- <?php endif ?>
- <li class="fields">
- <div class="field">
- <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
- <div class="input-box">
- <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" />
- </div>
- <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ão sabe o cep?</a></div>
- </div>
- <div class="field" style="display:none;">
- <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
- <div class="input-box">
- <?php echo $this->getCountryHtmlSelect('billing') ?>
- </div>
- </div>
- </li>
- <li class="wide">
- <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
- <div class="input-box">
- <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" />
- </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" 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" />
- </div>
- </li>
- <?php endfor ?>
- <li class="fields">
- <div class="field">
- <label for="billing:numero_end" class="required"><em>*</em><?php echo $this->__('Numero') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- <div class="field">
- <label for="billing:complemento_end"><?php echo $this->__('Complemento') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="billing:bairro" class="required"><em>*</em><?php echo $this->__('Bairro') ?></label>
- <div class="input-box">
- <input type="text" title="<?php echo $this->__('Bairro') ?>" name="billing[bairro]" value="" class="input-text required-entry" id="billing:bairro" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- <div class="field">
- <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
- <div class="input-box">
- <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select">
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
- </select>
- <script type="text/javascript">
- //<![CDATA[
- $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
- //]]>
- </script>
- <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" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- <div class="field">
- <label for="billing:fax"><?php echo $this->__('Celular') ?></label>
- <div class="input-box">
- <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" />
- </div>
- </div>
- </li>
- <?php if (!$this->isCustomerLoggedIn()): ?>
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
- <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
- <li class="fields">
- <?php if ($_dob->isEnabled()): ?>
- <div class="field">
- <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
- </div>
- <?php endif; ?>
- <?php if ($_gender->isEnabled()): ?>
- <div class="field">
- <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
- </div>
- <?php endif ?>
- </li>
- <?php endif ?>
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
- <?php if ($_taxvat->isEnabled()): ?>
- <li>
- <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
- </li>
- <?php endif ?>
- <li class="fields" id="register-customer-password">
- <div class="field">
- <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
- <div class="input-box">
- <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
- </div>
- </div>
- <div class="field">
- <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
- <div class="input-box">
- <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
- </div>
- </div>
- </li>
- <?php endif; ?>
- <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()): ?>
- <li class="control">
- <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>
- </li>
- <?php else: ?>
- <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
- <?php endif; ?>
- </ul>
- </fieldset>
- </li>
- </ul>
- <?php if (!$this->canShip()): ?>
- <input type="hidden" name="billing[use_for_shipping]" value="1" />
- <?php endif; ?>
- </fieldset>
- </form>
- <h1><?php echo $this->__('Shipping Address');?></h1>
- <?php if ($this->canShip()): ?>
- <ul class="form-list">
- <li class="control">
- <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>
- <li class="control">
- <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>
- </li>
- </ul>
- <?php endif; ?>
- <div id="shipping_address_change">
- <form action="" id="co-shipping-form">
- <ul class="form-list">
- <?php if ($this->customerHasAddresses()): ?>
- <li class="wide">
- <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
- <div class="input-box">
- <?php echo $this->getAddressesHtmlSelect('shipping') ?>
- </div>
- </li>
- <?php endif ?>
- <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
- <fieldset>
- <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
- <ul>
- <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>
- <li class="fields">
- <div class="fields">
- <label for="shipping:company"><?php echo $this->__('Company') ?></label>
- <div class="input-box">
- <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);" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
- <div class="input-box">
- <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" />
- </div>
- <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ão sabe o cep?</a></div>
- </div>
- <div class="field" style="display:none;">
- <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
- <div class="input-box">
- <?php echo $this->getCountryHtmlSelect('shipping') ?>
- </div>
- </div>
- </li>
- <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
- <li class="wide">
- <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
- <div class="input-box">
- <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);" />
- </div>
- </li>
- <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
- <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
- <li class="wide">
- <div class="input-box">
- <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);" />
- </div>
- </li>
- <?php endfor; ?>
- <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
- <li class="wide">
- <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
- <div class="input-box">
- <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') ?>" />
- </div>
- </li>
- <?php endif; ?>
- <li class="fields">
- <div class="field">
- <label for="shipping:numero_end" class="required"><em>*</em><?php echo $this->__('Numero') ?></label>
- <div class="input-box">
- <input type="text" title="<?php echo $this->__('Numero') ?>" name="shipping[numero_end]" value="" class="input-text required-entry" id="shipping:numero_end" />
- </div>
- </div>
- <div class="field">
- <label for="shipping:complemento_end"><?php echo $this->__('Complemento') ?></label>
- <div class="input-box">
- <input type="text" title="<?php echo $this->__('Complemento') ?>" name="shipping[complemento_end]" value="" class="input-text" id="shipping:complemento_end" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="shipping:bairro" class="required"><em>*</em><?php echo $this->__('Bairro') ?></label>
- <div class="input-box">
- <input type="text" title="<?php echo $this->__('Bairro') ?>" name="shipping[bairro]" value="" class="input-text required-entry" id="shipping:bairro" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
- <div class="input-box">
- <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);" />
- </div>
- </div>
- <div class="field">
- <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
- <div class="input-box">
- <select id="shipping:region_id" name="shipping[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[
- $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
- //]]>
- </script>
- <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;" />
- </div>
- </div>
- </li>
- <li class="fields">
- <div class="field">
- <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
- <div class="input-box">
- <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);" />
- </div>
- </div>
- <div class="field">
- <label for="shipping:fax"><?php echo $this->__('Celular') ?></label>
- <div class="input-box">
- <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);" />
- </div>
- </div>
- </li>
- <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
- <li class="control">
- <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>
- <?php else:?>
- <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
- <?php endif;?>
- </ul>
- </fieldset>
- </li>
- <li class="control no-display">
- <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>
- </li>
- </ul>
- </form>
- </div>
- <h1><?php echo $this->__('Escolha o Modo de Envio');?></h1>
- <form id="co-shipping-method-form" action="">
- <div id="checkout-shipping-method-load">
- <?php echo $this->getChildHtml('available') ?>
- </div>
- <script type="text/javascript">
- //<![CDATA[
- var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('checkout/onepage/saveShippingMethod') ?>");
- //]]>
- </script>
- <div id="onepage-checkout-shipping-method-additional-load">
- <?php echo $this->getChildHtml('additional') ?>
- </div>
- </form>
- <div id="billing-buttons-container">
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
- <button type="button" class="btn-checkout_4on" title="<?php echo $this->__('Continue') ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
- <div class="clear"></div>
- <div class="grid_12 alpha">
- <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>
- </div>
- <div class="grid_12 a-right omega">
- <button type="button" class="btn-checkout_4on btn-setStep" onclick="shippingMethod.save();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
- <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
- <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...') ?>
- </span>
- </div>
- <div class="clear"></div>
- </div>
- <script type="text/javascript">
- //<![CDATA[
- var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
- var billingForm = new VarienForm('co-billing-form');
- billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
- $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
- var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
- var countryRegions = <?php echo $this->helper('directory')->getRegionJson(); ?>;
- if ($('onepage-guest-register-button')) {
- Event.observe($('onepage-guest-register-button'), 'click', function(event) {
- var billingRememberMe = $('co-billing-form').select('#remember-me-box');
- if (billingRememberMe.length > 0) {
- if ($('login:guest') && $('login:guest').checked) {
- billingRememberMe[0].hide();
- } else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
- billingRememberMe[0].show();
- }
- }
- });
- }
- //]]>
- </script>
- <!--<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/prototype.maskedinput.js') ?>"></script>-->
- <!--<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/validaCPFCNPJ.js'); ?>"></script> -->
- <script type="text/javascript">
- //<![CDATA[
- Event.observe(window, 'load', function() {
- /*new mask(".cpf", '999.999.999-99');
- new mask(".cnpj", '99.999.999/9999-99');
- new mask(".mask_postcode", '99999-999');*/
- jQuery('.cpf').mask('999.999.999-99');
- jQuery('.cnpj').mask('99.999.999/9999-99');
- jQuery('.mask_postcode').mask('99999-999');
- jQuery('.mask_tel').mask("(99) 9999-9999?9").ready(function(event) {
- var target, phone, element;
- target = (event.currentTarget) ? event.currentTarget : event.srcElement;
- phone = target.value.replace(/\D/g, '');
- element = $(target);
- element.unmask();
- if(phone.length > 10) {
- element.mask("(99) 99999-999?9");
- } else {
- element.mask("(99) 9999-9999?9");
- }
- });
- });
- //]]>
- </script>
- <script type="text/javascript">
- //<![CDATA[
- jQuery("#shipping_address_change").addClass("no-display");
- function vEntrega(){
- //jQuery(".control:eq(1)").remove();
- if(jQuery(".sameaddress").is(':checked')){
- jQuery("#shipping_address_change").addClass("no-display");
- }else{
- jQuery("#shipping_address_change").removeClass("no-display");
- }
- }
- jQuery(".control input").change(function(){vEntrega();});
- vEntrega();
- /*jQuery(function ($){
- function vEntrega(){
- if($("#billing:use_for_shipping_yes").isChecked())
- $("#shipping_address_change").removeClass("no-display");
- else
- $("#shipping_address_change").addClass("no-display");
- }
- vEntrega();
- /*$(".control #billing:use_for_shipping_yes, .control #billing:use_for_shipping_no").click(function(){
- alert("teste");
- });
- });
- jQuery("#shipping:same_as_billing").change(function() {
- alert("teste");
- });*/
- function fireEvent(element, event) {
- if (document.createEvent) {
- // dispatch for firefox + others
- var evt = document.createEvent("HTMLEvents");
- evt.initEvent(event, true, true); // event type,bubbling,cancelable
- return !element.dispatchEvent(evt);
- } else {
- // dispatch for IE
- var evt = document.createEventObject();
- return element.fireEvent('on' + event, evt)
- }
- }
- function buscar_end() {
- local = "billing";
- $(local + ':street1').value = '';
- if ($(local + ':street2'))
- $(local + ':street2').value = '';
- if ($(local + ':street3'))
- $(local + ':street3').value = '';
- if ($(local + ':street4'))
- $(local + ':street4').value = '';
- if ($(local + ':region'))
- $(local + ':region').value = '';
- if ($(local + ': city'))
- $(local + ':city').value = '';
- if ($(local + ':region_id')){
- $(local + ':region_id').value = '';
- }if ($(local + ':bairro'))
- $(local + ':bairro').value = '';
- if ($(local + ':numero_end'))
- $(local + ':numero_end').value = '';
- if ($(local + ':complemento_end'))
- $(local + ':complemento_end').value = '';
- var urlAjax = location.href;
- var validarUrl = /^https:\/\//;
- if (urlAjax.match(validarUrl)) {
- urlAjax = '<?php echo Mage::getBaseUrl("link", true) . "ajaxend/ajax" ?>';
- } else {
- urlAjax = '<?php echo $this->getUrl("ajaxend/ajax") ?>';
- }
- new Ajax.Request(urlAjax, {method: 'POST',
- parameters: 'cep=' + $(local + ':postcode').value,
- evalScripts: true,
- onLoading: function(transport) {
- $('load-end-' + local).innerHTML = '<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" /> <span style="color: #888;">Carregando...</span>';
- },
- onComplete: function(transport) {
- $('load-end-' + local).innerHTML = '<a href="http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro" target="_blank">não sabe o cep?</a>';
- },
- onSuccess: function(transport) {
- if (200 == transport.status) {
- try {
- var res = transport.responseText.evalJSON();
- if (res.resultado > 0) {
- $(local + ':street1').value = res.tipo_logradouro + ' ' + res.logradouro;
- if ($(local + ':bairro'))
- $(local + ':bairro').value = res.bairro;
- //if ($(local + ':street2'))
- // $(local + ':street2').value = res.bairro;
- $(local + ':city').value = res.cidade;
- if ($(local + ':region'))
- $(local + ':region').value = res.uf;
- if ($(local + ':region_id')) {
- for (var obj in countryRegions['BR']) {
- if (res.uf == countryRegions['BR'][obj].code) {
- $(local + ':region_id').value = obj;
- }
- }
- }
- fireEvent($(local + ':postcode'), 'change');
- }
- } catch (e) {
- alert( e.message );
- }
- } else {
- alert( transport );
- }
- },
- onFailure: function() { document.getElementById("...").innerHTML = 'problemas...';}
- });
- }
- //]]>
- Validation.add('validar_cpf', 'O CPF informado \xE9 invalido', function(v) {
- return validaCPF(v, 0);
- });
- Validation.add('validar_cnpj', 'O CNPJ informado \xE9 invalido', function(v) {
- return validaCPF(v, 0);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement