Version Notes
First version of Residential/Commercial module is released
Download this release
Release Info
| Developer | Commerce Bees |
| Extension | CommerceBees_ResidentialCommercial_v1 |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- CommerceBees_ResidentialCommercial_Extension_Guide_V1.0.pdf +0 -0
- app/code/community/Ameex/ResidentialCommercial/Model/Source.php +19 -0
- app/code/community/Ameex/ResidentialCommercial/etc/config.xml +83 -0
- app/code/community/Ameex/ResidentialCommercial/sql/residentialcommercial_setup/mysql4-install-1.0.0.php +32 -0
- app/design/frontend/default/default/template/checkout/onepage/shipping.phtml +170 -0
- app/design/frontend/default/default/template/customer/address/edit.phtml +179 -0
- app/design/frontend/default/default/template/persistent/checkout/onepage/billing.phtml +240 -0
- app/design/frontend/default/default/template/persistent/customer/form/register.phtml +203 -0
- app/etc/modules/Ameex_ResidentialCommercial.xml +9 -0
- package.xml +18 -0
- uninstall_ameex_residentialcommercial_module_bak.php +16 -0
CommerceBees_ResidentialCommercial_Extension_Guide_V1.0.pdf
ADDED
|
Binary file
|
app/code/community/Ameex/ResidentialCommercial/Model/Source.php
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ameex_ResidentialCommercial_Model_Source extends Mage_Eav_Model_Entity_Attribute_Source_Table
|
| 3 |
+
{
|
| 4 |
+
public function getAllOptions()
|
| 5 |
+
{
|
| 6 |
+
$options = array(2=>'Residential',1=>'Commercial');
|
| 7 |
+
return $options;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
public function getOptionText($value)
|
| 11 |
+
{
|
| 12 |
+
if($value == 1)
|
| 13 |
+
return 'Commercial';
|
| 14 |
+
elseif($value == 2)
|
| 15 |
+
return 'Residential';
|
| 16 |
+
else
|
| 17 |
+
return false;
|
| 18 |
+
}
|
| 19 |
+
}
|
app/code/community/Ameex/ResidentialCommercial/etc/config.xml
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Ameex_ResidentialCommercial>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Ameex_ResidentialCommercial>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<models>
|
| 10 |
+
<residentialcommercial>
|
| 11 |
+
<class>Ameex_ResidentialCommercial_Model</class>
|
| 12 |
+
</residentialcommercial>
|
| 13 |
+
</models>
|
| 14 |
+
<resources>
|
| 15 |
+
<residentialcommercial_setup>
|
| 16 |
+
<setup>
|
| 17 |
+
<module>Ameex_ResidentialCommercial</module>
|
| 18 |
+
<class>Mage_Customer_Model_Resource_Setup</class>
|
| 19 |
+
</setup>
|
| 20 |
+
</residentialcommercial_setup>
|
| 21 |
+
</resources>
|
| 22 |
+
<fieldsets>
|
| 23 |
+
<sales_convert_quote_address>
|
| 24 |
+
<residentialcommercial>
|
| 25 |
+
<to_order_address>*</to_order_address>
|
| 26 |
+
<to_customer_address>*</to_customer_address>
|
| 27 |
+
</residentialcommercial>
|
| 28 |
+
</sales_convert_quote_address>
|
| 29 |
+
<customer_address>
|
| 30 |
+
<residentialcommercial>
|
| 31 |
+
<to_quote_address>*</to_quote_address>
|
| 32 |
+
</residentialcommercial>
|
| 33 |
+
</customer_address>
|
| 34 |
+
</fieldsets>
|
| 35 |
+
</global>
|
| 36 |
+
<default>
|
| 37 |
+
<customer>
|
| 38 |
+
<address_templates>
|
| 39 |
+
<text>{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
|
| 40 |
+
{{depend company}}{{var company}}{{/depend}}
|
| 41 |
+
Address Type: {{depend residentialcommercial}}{{var residentialcommercial}}{{/depend}}
|
| 42 |
+
{{if street1}}{{var street1}}
|
| 43 |
+
{{/if}}
|
| 44 |
+
{{depend street2}}{{var street2}}{{/depend}}
|
| 45 |
+
{{depend street3}}{{var street3}}{{/depend}}
|
| 46 |
+
{{depend street4}}{{var street4}}{{/depend}}
|
| 47 |
+
{{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}
|
| 48 |
+
{{var country}}
|
| 49 |
+
T: {{var telephone}}
|
| 50 |
+
{{depend fax}}F: {{var fax}}{{/depend}}
|
| 51 |
+
{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}</text>
|
| 52 |
+
<oneline>{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{depend residentialcommercial}}{{var residentialcommercial}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}</oneline>
|
| 53 |
+
<html><![CDATA[{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/>
|
| 54 |
+
{{depend company}}{{var company}}<br />{{/depend}}
|
| 55 |
+
Address Type: {{depend residentialcommercial}}{{var residentialcommercial}}{{/depend}}<br/>
|
| 56 |
+
{{if street1}}{{var street1}}<br />{{/if}}
|
| 57 |
+
{{depend street2}}{{var street2}}<br />{{/depend}}
|
| 58 |
+
{{depend street3}}{{var street3}}<br />{{/depend}}
|
| 59 |
+
{{depend street4}}{{var street4}}<br />{{/depend}}
|
| 60 |
+
{{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}<br/>
|
| 61 |
+
{{var country}}<br/>
|
| 62 |
+
{{depend telephone}}T: {{var telephone}}{{/depend}}
|
| 63 |
+
{{depend fax}}<br/>F: {{var fax}}{{/depend}}
|
| 64 |
+
{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}]]></html>
|
| 65 |
+
<pdf><![CDATA[{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}|
|
| 66 |
+
{{depend company}}{{var company}}|{{/depend}}
|
| 67 |
+
Address Type: {{depend residentialcommercial}}{{var residentialcommercial}}{{/depend}}|
|
| 68 |
+
{{if street1}}{{var street1}}
|
| 69 |
+
{{/if}}
|
| 70 |
+
{{depend street2}}{{var street2}}|{{/depend}}
|
| 71 |
+
{{depend street3}}{{var street3}}|{{/depend}}
|
| 72 |
+
{{depend street4}}{{var street4}}|{{/depend}}
|
| 73 |
+
{{if city}}{{var city}},|{{/if}}
|
| 74 |
+
{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}|
|
| 75 |
+
{{var country}}|
|
| 76 |
+
{{depend telephone}}T: {{var telephone}}{{/depend}}|
|
| 77 |
+
{{depend fax}}<br/>F: {{var fax}}{{/depend}}|
|
| 78 |
+
{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}|]]></pdf>
|
| 79 |
+
<js_template><![CDATA[#{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{residentialcommercial}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax}<br/>VAT: #{vat_id}]]></js_template>
|
| 80 |
+
</address_templates>
|
| 81 |
+
</customer>
|
| 82 |
+
</default>
|
| 83 |
+
</config>
|
app/code/community/Ameex/ResidentialCommercial/sql/residentialcommercial_setup/mysql4-install-1.0.0.php
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$installer = $this;
|
| 3 |
+
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$installer->addAttribute('customer_address', 'residentialcommercial', array(
|
| 7 |
+
'type' => 'int',
|
| 8 |
+
'input' => 'select',
|
| 9 |
+
'label' => 'Address Type',
|
| 10 |
+
'global' => 1,
|
| 11 |
+
'visible' => 1,
|
| 12 |
+
'required' => 0,
|
| 13 |
+
'user_defined' => 1,
|
| 14 |
+
'visible_on_front' => 1
|
| 15 |
+
));
|
| 16 |
+
$installer->updateAttribute(
|
| 17 |
+
'customer_address',
|
| 18 |
+
'residentialcommercial',
|
| 19 |
+
'source_model',
|
| 20 |
+
'residentialcommercial/source'
|
| 21 |
+
);
|
| 22 |
+
Mage::getSingleton('eav/config')
|
| 23 |
+
->getAttribute('customer_address', 'residentialcommercial')
|
| 24 |
+
->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
|
| 25 |
+
->save();
|
| 26 |
+
|
| 27 |
+
$tablequote = $this->getTable('sales/quote_address');
|
| 28 |
+
$installer->run("ALTER TABLE $tablequote ADD COLUMN residentialcommercial INT(2) NOT NULL");
|
| 29 |
+
|
| 30 |
+
$tablequote = $this->getTable('sales/order_address');
|
| 31 |
+
$installer->run("ALTER TABLE $tablequote ADD COLUMN residentialcommercial INT(2) NOT NULL");
|
| 32 |
+
$installer->endSetup();
|
app/design/frontend/default/default/template/checkout/onepage/shipping.phtml
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) 2012 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 |
+
<form action="" id="co-shipping-form">
|
| 28 |
+
<ul class="form-list">
|
| 29 |
+
<?php if ($this->customerHasAddresses()): ?>
|
| 30 |
+
<li class="wide">
|
| 31 |
+
<label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
|
| 32 |
+
<div class="input-box">
|
| 33 |
+
<?php echo $this->getAddressesHtmlSelect('shipping') ?>
|
| 34 |
+
</div>
|
| 35 |
+
</li>
|
| 36 |
+
<?php endif ?>
|
| 37 |
+
<li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
|
| 38 |
+
<fieldset>
|
| 39 |
+
<input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
|
| 40 |
+
<ul>
|
| 41 |
+
<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>
|
| 42 |
+
<li class="fields">
|
| 43 |
+
<div class="fields">
|
| 44 |
+
<label for="shipping:company"><?php echo $this->__('Company') ?></label>
|
| 45 |
+
<div class="input-box">
|
| 46 |
+
<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);" />
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</li>
|
| 50 |
+
<li class="fields">
|
| 51 |
+
<?php $attribute = Mage::getModel('eav/config')->getAttribute('customer_address','residentialcommercial'); ?>
|
| 52 |
+
<div class="field">
|
| 53 |
+
<label for="shipping:residentialcommercial"><?php echo $this->__('Address Type') ?></label>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="input-box">
|
| 56 |
+
<select id="residentialcommercial" name="shipping[residentialcommercial]" title="<?php echo $this->__('Address Type') ?>" class="validate-select">
|
| 57 |
+
<?php $options = $attribute->getSource()->getAllOptions(); ?>
|
| 58 |
+
<?php foreach($options as $key=>$value): ?>
|
| 59 |
+
<option value="<?php echo $key ?>"<?php if($this->getAddress()->getResidentialcommercial()==$key) echo " selected=\"selected\""; ?>><?php echo $value ?></option>
|
| 60 |
+
<?php endforeach; ?>
|
| 61 |
+
</select>
|
| 62 |
+
</div>
|
| 63 |
+
</li>
|
| 64 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
| 65 |
+
<li class="wide">
|
| 66 |
+
<label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
| 67 |
+
<div class="input-box">
|
| 68 |
+
<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);" />
|
| 69 |
+
</div>
|
| 70 |
+
</li>
|
| 71 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
| 72 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
| 73 |
+
<li class="wide">
|
| 74 |
+
<div class="input-box">
|
| 75 |
+
<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);" />
|
| 76 |
+
</div>
|
| 77 |
+
</li>
|
| 78 |
+
<?php endfor; ?>
|
| 79 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
| 80 |
+
<li class="wide">
|
| 81 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
| 82 |
+
<div class="input-box">
|
| 83 |
+
<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') ?>" />
|
| 84 |
+
</div>
|
| 85 |
+
</li>
|
| 86 |
+
<?php endif; ?>
|
| 87 |
+
<li class="fields">
|
| 88 |
+
<div class="field">
|
| 89 |
+
<label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
| 90 |
+
<div class="input-box">
|
| 91 |
+
<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);" />
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="field">
|
| 95 |
+
<label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
| 96 |
+
<div class="input-box">
|
| 97 |
+
<select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
| 98 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
| 99 |
+
</select>
|
| 100 |
+
<script type="text/javascript">
|
| 101 |
+
//<![CDATA[
|
| 102 |
+
$('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
| 103 |
+
//]]>
|
| 104 |
+
</script>
|
| 105 |
+
<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;" />
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</li>
|
| 109 |
+
<li class="fields">
|
| 110 |
+
<div class="field">
|
| 111 |
+
<label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
| 112 |
+
<div class="input-box">
|
| 113 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="field">
|
| 117 |
+
<label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
| 118 |
+
<div class="input-box">
|
| 119 |
+
<?php echo $this->getCountryHtmlSelect('shipping') ?>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
</li>
|
| 123 |
+
<li class="fields">
|
| 124 |
+
<div class="field">
|
| 125 |
+
<label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
| 126 |
+
<div class="input-box">
|
| 127 |
+
<input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="field">
|
| 131 |
+
<label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
|
| 132 |
+
<div class="input-box">
|
| 133 |
+
<input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
</li>
|
| 137 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
| 138 |
+
<li class="control">
|
| 139 |
+
<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>
|
| 140 |
+
<?php else:?>
|
| 141 |
+
<li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
|
| 142 |
+
<?php endif;?>
|
| 143 |
+
</ul>
|
| 144 |
+
</fieldset>
|
| 145 |
+
</li>
|
| 146 |
+
<li class="control">
|
| 147 |
+
<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>
|
| 148 |
+
</li>
|
| 149 |
+
</ul>
|
| 150 |
+
<div class="buttons-set" id="shipping-buttons-container">
|
| 151 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
| 152 |
+
<p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
| 153 |
+
<button type="button" class="button" title="<?php echo $this->__('Continue') ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
| 154 |
+
<span id="shipping-please-wait" class="please-wait" style="display:none;">
|
| 155 |
+
<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...') ?>
|
| 156 |
+
</span>
|
| 157 |
+
</div>
|
| 158 |
+
</form>
|
| 159 |
+
<script type="text/javascript">
|
| 160 |
+
//<![CDATA[
|
| 161 |
+
var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
|
| 162 |
+
'<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
|
| 163 |
+
var shippingForm = new VarienForm('co-shipping-form');
|
| 164 |
+
shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
|
| 165 |
+
//shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
| 166 |
+
$('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
|
| 167 |
+
|
| 168 |
+
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
|
| 169 |
+
//]]>
|
| 170 |
+
</script>
|
app/design/frontend/default/default/template/customer/address/edit.phtml
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) 2012 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 |
+
<?php
|
| 28 |
+
/**
|
| 29 |
+
* Edit customer address template
|
| 30 |
+
*
|
| 31 |
+
* @see Mage_Customer_Block_Address_Edit
|
| 32 |
+
*/
|
| 33 |
+
?>
|
| 34 |
+
<?php if($this->getTitle()): ?>
|
| 35 |
+
<div class="page-title">
|
| 36 |
+
<h1><?php echo $this->getTitle() ?></h1>
|
| 37 |
+
</div>
|
| 38 |
+
<?php endif; ?>
|
| 39 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
| 40 |
+
<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
|
| 41 |
+
<div class="fieldset">
|
| 42 |
+
<?php echo $this->getBlockHtml('formkey')?>
|
| 43 |
+
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
| 44 |
+
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
|
| 45 |
+
<h2 class="legend"><?php echo $this->__('Contact Information') ?></h2>
|
| 46 |
+
<ul class="form-list">
|
| 47 |
+
<li class="fields">
|
| 48 |
+
<?php echo $this->getNameBlockHtml() ?>
|
| 49 |
+
</li>
|
| 50 |
+
<li class="wide">
|
| 51 |
+
<label for="company"><?php echo $this->__('Company') ?></label>
|
| 52 |
+
<div class="input-box">
|
| 53 |
+
<input type="text" name="company" id="company" title="<?php echo $this->__('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
| 54 |
+
</div>
|
| 55 |
+
</li>
|
| 56 |
+
<li class="fields">
|
| 57 |
+
<?php $attribute = Mage::getModel('eav/config')->getAttribute('customer_address','residentialcommercial'); ?>
|
| 58 |
+
<div class="field">
|
| 59 |
+
<label for="residentialcommercial"><?php echo $this->__('Address Type') ?></label>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="input-box">
|
| 62 |
+
<select id="residentialcommercial" name="residentialcommercial" title="<?php echo $this->__('Address Type') ?>" class="validate-select">
|
| 63 |
+
<?php $options = $attribute->getSource()->getAllOptions(); ?>
|
| 64 |
+
<?php foreach($options as $key=>$value): ?>
|
| 65 |
+
<option value="<?php echo $key ?>"<?php if($this->getAddress()->getResidentialcommercial()==$key) echo " selected=\"selected\""; ?>><?php echo $value ?></option>
|
| 66 |
+
<?php endforeach; ?>
|
| 67 |
+
</select>
|
| 68 |
+
</div>
|
| 69 |
+
</li>
|
| 70 |
+
<li class="fields">
|
| 71 |
+
<div class="field">
|
| 72 |
+
<label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
| 73 |
+
<div class="input-box">
|
| 74 |
+
<input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="telephone" />
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="field">
|
| 78 |
+
<label for="fax"><?php echo $this->__('Fax') ?></label>
|
| 79 |
+
<div class="input-box">
|
| 80 |
+
<input type="text" name="fax" id="fax" title="<?php echo $this->__('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" />
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</li>
|
| 84 |
+
</ul>
|
| 85 |
+
</div>
|
| 86 |
+
<div class="fieldset">
|
| 87 |
+
<h2 class="legend"><?php echo $this->__('Address') ?></h2>
|
| 88 |
+
<ul class="form-list">
|
| 89 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
| 90 |
+
<li class="wide">
|
| 91 |
+
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
|
| 92 |
+
<div class="input-box">
|
| 93 |
+
<input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 94 |
+
</div>
|
| 95 |
+
</li>
|
| 96 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
| 97 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
| 98 |
+
<li class="wide">
|
| 99 |
+
<div class="input-box">
|
| 100 |
+
<input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 101 |
+
</div>
|
| 102 |
+
</li>
|
| 103 |
+
<?php endfor; ?>
|
| 104 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
| 105 |
+
<li class="wide">
|
| 106 |
+
<label for="vat_id"><?php echo $this->__('VAT Number') ?></label>
|
| 107 |
+
<div class="input-box">
|
| 108 |
+
<input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" id="vat_id" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
| 109 |
+
</div>
|
| 110 |
+
</li>
|
| 111 |
+
<?php endif; ?>
|
| 112 |
+
<li class="fields">
|
| 113 |
+
<div class="field">
|
| 114 |
+
<label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
| 115 |
+
<div class="input-box">
|
| 116 |
+
<input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
<div class="field">
|
| 120 |
+
<label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
| 121 |
+
<div class="input-box">
|
| 122 |
+
<select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
| 123 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
| 124 |
+
</select>
|
| 125 |
+
<script type="text/javascript">
|
| 126 |
+
//<![CDATA[
|
| 127 |
+
$('region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
| 128 |
+
//]]>
|
| 129 |
+
</script>
|
| 130 |
+
<input type="text" id="region" name="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') ?>" />
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
</li>
|
| 134 |
+
<li class="fields">
|
| 135 |
+
<div class="field">
|
| 136 |
+
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
| 137 |
+
<div class="input-box">
|
| 138 |
+
<input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
<div class="field">
|
| 142 |
+
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
| 143 |
+
<div class="input-box">
|
| 144 |
+
<?php echo $this->getCountryHtmlSelect() ?>
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
</li>
|
| 148 |
+
<li<?php if($this->canSetAsDefaultBilling()) echo ' class="control"' ?>>
|
| 149 |
+
<?php if($this->isDefaultBilling()): ?>
|
| 150 |
+
<strong><?php echo $this->__('Default Billing Address') ?></strong>
|
| 151 |
+
<?php elseif($this->canSetAsDefaultBilling()): ?>
|
| 152 |
+
<input type="checkbox" id="primary_billing" name="default_billing" value="1" title="<?php echo $this->__('Use as My Default Billing Address') ?>" class="checkbox" /><label for="primary_billing"><?php echo $this->__('Use as my default billing address') ?></label>
|
| 153 |
+
<?php else: ?>
|
| 154 |
+
<input type="hidden" name="default_billing" value="1" />
|
| 155 |
+
<?php endif; ?>
|
| 156 |
+
</li>
|
| 157 |
+
<li<?php if($this->canSetAsDefaultShipping()) echo ' class="control"' ?>>
|
| 158 |
+
<?php if($this->isDefaultShipping()): ?>
|
| 159 |
+
<strong><?php echo $this->__('Default Shipping Address') ?></strong>
|
| 160 |
+
<?php elseif($this->canSetAsDefaultShipping()): ?>
|
| 161 |
+
<input type="checkbox" id="primary_shipping" name="default_shipping" value="1" title="<?php echo $this->__('Use as My Default Shipping Address') ?>" class="checkbox" /><label for="primary_shipping"><?php echo $this->__('Use as my default shipping address') ?></label>
|
| 162 |
+
<?php else: ?>
|
| 163 |
+
<input type="hidden" name="default_shipping" value="1" />
|
| 164 |
+
<?php endif; ?>
|
| 165 |
+
</li>
|
| 166 |
+
</ul>
|
| 167 |
+
</div>
|
| 168 |
+
<div class="buttons-set">
|
| 169 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
| 170 |
+
<p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
| 171 |
+
<button type="submit" title="<?php echo $this->__('Save Address') ?>" class="button"><span><span><?php echo $this->__('Save Address') ?></span></span></button>
|
| 172 |
+
</div>
|
| 173 |
+
</form>
|
| 174 |
+
<script type="text/javascript">
|
| 175 |
+
//<![CDATA[
|
| 176 |
+
var dataForm = new VarienForm('form-validate', true);
|
| 177 |
+
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
| 178 |
+
//]]>
|
| 179 |
+
</script>
|
app/design/frontend/default/default/template/persistent/checkout/onepage/billing.phtml
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) 2012 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
/** @var Mage_Checkout_Block_Onepage_Billing $this */
|
| 27 |
+
?>
|
| 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()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->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->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
| 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->escapeHtml($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 |
+
<li class="fields">
|
| 61 |
+
<?php $attribute = Mage::getModel('eav/config')->getAttribute('customer_address','residentialcommercial'); ?>
|
| 62 |
+
<div class="field">
|
| 63 |
+
<label for="billing:residentialcommercial"><?php echo $this->__('Address Type') ?></label>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="input-box">
|
| 66 |
+
<select id="residentialcommercial" name="billing[residentialcommercial]" title="<?php echo $this->__('Address Type') ?>" class="validate-select">
|
| 67 |
+
<?php $options = $attribute->getSource()->getAllOptions(); ?>
|
| 68 |
+
<?php foreach($options as $key=>$value): ?>
|
| 69 |
+
<option value="<?php echo $key ?>"<?php if($this->getAddress()->getResidentialcommercial()==$key) echo " selected=\"selected\""; ?>><?php echo $value ?></option>
|
| 70 |
+
<?php endforeach; ?>
|
| 71 |
+
</select>
|
| 72 |
+
</div>
|
| 73 |
+
</li>
|
| 74 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
| 75 |
+
<li class="wide">
|
| 76 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
| 77 |
+
<div class="input-box">
|
| 78 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 79 |
+
</div>
|
| 80 |
+
</li>
|
| 81 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
| 82 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
| 83 |
+
<li class="wide">
|
| 84 |
+
<div class="input-box">
|
| 85 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 86 |
+
</div>
|
| 87 |
+
</li>
|
| 88 |
+
<?php endfor; ?>
|
| 89 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
| 90 |
+
<li class="wide">
|
| 91 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
|
| 92 |
+
<div class="input-box">
|
| 93 |
+
<input type="text" id="billing:vat_id" name="billing[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') ?>" />
|
| 94 |
+
</div>
|
| 95 |
+
</li>
|
| 96 |
+
<?php endif; ?>
|
| 97 |
+
<li class="fields">
|
| 98 |
+
<div class="field">
|
| 99 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
| 100 |
+
<div class="input-box">
|
| 101 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
<div class="field">
|
| 105 |
+
<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
| 106 |
+
<div class="input-box">
|
| 107 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
| 108 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
| 109 |
+
</select>
|
| 110 |
+
<script type="text/javascript">
|
| 111 |
+
//<![CDATA[
|
| 112 |
+
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
| 113 |
+
//]]>
|
| 114 |
+
</script>
|
| 115 |
+
<input type="text" id="billing:region" name="billing[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;" />
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
</li>
|
| 119 |
+
<li class="fields">
|
| 120 |
+
<div class="field">
|
| 121 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
| 122 |
+
<div class="input-box">
|
| 123 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="field">
|
| 127 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
| 128 |
+
<div class="input-box">
|
| 129 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
</li>
|
| 133 |
+
<li class="fields">
|
| 134 |
+
<div class="field">
|
| 135 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
| 136 |
+
<div class="input-box">
|
| 137 |
+
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
<div class="field">
|
| 141 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
| 142 |
+
<div class="input-box">
|
| 143 |
+
<input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
</li>
|
| 147 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
| 148 |
+
|
| 149 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
| 150 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
| 151 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
| 152 |
+
<li class="fields">
|
| 153 |
+
<?php if ($_dob->isEnabled()): ?>
|
| 154 |
+
<div class="field">
|
| 155 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
| 156 |
+
</div>
|
| 157 |
+
<?php endif; ?>
|
| 158 |
+
<?php if ($_gender->isEnabled()): ?>
|
| 159 |
+
<div class="field">
|
| 160 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
| 161 |
+
</div>
|
| 162 |
+
<?php endif ?>
|
| 163 |
+
</li>
|
| 164 |
+
<?php endif ?>
|
| 165 |
+
|
| 166 |
+
<?php if ($this->isTaxvatEnabled()):?>
|
| 167 |
+
<li><?php echo $this->getTaxvatHtml() ?></li>
|
| 168 |
+
<?php endif; ?>
|
| 169 |
+
|
| 170 |
+
<li class="fields" id="register-customer-password">
|
| 171 |
+
<div class="field">
|
| 172 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
| 173 |
+
<div class="input-box">
|
| 174 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
<div class="field">
|
| 178 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
| 179 |
+
<div class="input-box">
|
| 180 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
</li>
|
| 184 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
| 185 |
+
<?php endif; ?>
|
| 186 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
| 187 |
+
<li class="control">
|
| 188 |
+
<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>
|
| 189 |
+
</li>
|
| 190 |
+
<?php else:?>
|
| 191 |
+
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
|
| 192 |
+
<?php endif; ?>
|
| 193 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
| 194 |
+
</ul>
|
| 195 |
+
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
|
| 196 |
+
</fieldset>
|
| 197 |
+
</li>
|
| 198 |
+
<?php if ($this->canShip()): ?>
|
| 199 |
+
<li class="control">
|
| 200 |
+
<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" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
|
| 201 |
+
<li class="control">
|
| 202 |
+
<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>
|
| 203 |
+
</li>
|
| 204 |
+
<?php endif; ?>
|
| 205 |
+
</ul>
|
| 206 |
+
<?php if (!$this->canShip()): ?>
|
| 207 |
+
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
| 208 |
+
<?php endif; ?>
|
| 209 |
+
<div class="buttons-set" id="billing-buttons-container">
|
| 210 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
| 211 |
+
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
| 212 |
+
<span class="please-wait" id="billing-please-wait" style="display:none;">
|
| 213 |
+
<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...') ?>
|
| 214 |
+
</span>
|
| 215 |
+
</div>
|
| 216 |
+
</fieldset>
|
| 217 |
+
</form>
|
| 218 |
+
<script type="text/javascript">
|
| 219 |
+
//<![CDATA[
|
| 220 |
+
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
|
| 221 |
+
var billingForm = new VarienForm('co-billing-form');
|
| 222 |
+
|
| 223 |
+
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
| 224 |
+
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
|
| 225 |
+
|
| 226 |
+
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
|
| 227 |
+
if ($('onepage-guest-register-button')) {
|
| 228 |
+
Event.observe($('onepage-guest-register-button'), 'click', function(event) {
|
| 229 |
+
var billingRememberMe = $('co-billing-form').select('#remember-me-box');
|
| 230 |
+
if (billingRememberMe.length > 0) {
|
| 231 |
+
if ($('login:guest') && $('login:guest').checked) {
|
| 232 |
+
billingRememberMe[0].hide();
|
| 233 |
+
} else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
|
| 234 |
+
billingRememberMe[0].show();
|
| 235 |
+
}
|
| 236 |
+
}
|
| 237 |
+
});
|
| 238 |
+
}
|
| 239 |
+
//]]>
|
| 240 |
+
</script>
|
app/design/frontend/default/default/template/persistent/customer/form/register.phtml
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) 2012 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 |
+
<?php
|
| 28 |
+
/**
|
| 29 |
+
* Create account form template
|
| 30 |
+
*
|
| 31 |
+
* @see app/design/frontend/base/default/template/customer/form/register.phtml
|
| 32 |
+
*/
|
| 33 |
+
/** @var $this Mage_Customer_Block_Form_Register */
|
| 34 |
+
?>
|
| 35 |
+
<div class="account-create">
|
| 36 |
+
<div class="page-title">
|
| 37 |
+
<h1><?php echo $this->__('Create an Account') ?></h1>
|
| 38 |
+
</div>
|
| 39 |
+
<?php echo $this->getChildHtml('form_fields_before')?>
|
| 40 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
| 41 |
+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
|
| 42 |
+
<div class="fieldset">
|
| 43 |
+
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
| 44 |
+
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
|
| 45 |
+
<h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
|
| 46 |
+
<ul class="form-list">
|
| 47 |
+
<li class="fields">
|
| 48 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
|
| 49 |
+
</li>
|
| 50 |
+
<li>
|
| 51 |
+
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
| 52 |
+
<div class="input-box">
|
| 53 |
+
<input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
| 54 |
+
</div>
|
| 55 |
+
</li>
|
| 56 |
+
<?php if ($this->isNewsletterEnabled()): ?>
|
| 57 |
+
<li class="control">
|
| 58 |
+
<div class="input-box">
|
| 59 |
+
<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" />
|
| 60 |
+
</div>
|
| 61 |
+
<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
|
| 62 |
+
</li>
|
| 63 |
+
<?php endif ?>
|
| 64 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
| 65 |
+
<?php if ($_dob->isEnabled()): ?>
|
| 66 |
+
<li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
|
| 67 |
+
<?php endif ?>
|
| 68 |
+
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
| 69 |
+
<?php if ($_taxvat->isEnabled()): ?>
|
| 70 |
+
<li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
|
| 71 |
+
<?php endif ?>
|
| 72 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
| 73 |
+
<?php if ($_gender->isEnabled()): ?>
|
| 74 |
+
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
|
| 75 |
+
<?php endif ?>
|
| 76 |
+
</ul>
|
| 77 |
+
</div>
|
| 78 |
+
<?php if($this->getShowAddressFields()): ?>
|
| 79 |
+
<div class="fieldset">
|
| 80 |
+
<input type="hidden" name="create_address" value="1" />
|
| 81 |
+
<h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
|
| 82 |
+
<ul class="form-list">
|
| 83 |
+
<li class="fields">
|
| 84 |
+
<div class="field">
|
| 85 |
+
<label for="company"><?php echo $this->__('Company') ?></label>
|
| 86 |
+
<div class="input-box">
|
| 87 |
+
<input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
<div class="field">
|
| 91 |
+
<label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
| 92 |
+
<div class="input-box">
|
| 93 |
+
<input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</li>
|
| 97 |
+
<li class="fields">
|
| 98 |
+
<div class="field">
|
| 99 |
+
<label for="residentialcommercial"><?php echo $this->__('Address Type') ?></label>
|
| 100 |
+
</div>
|
| 101 |
+
<div class="input-box">
|
| 102 |
+
<select id="residentialcommercial" name="residentialcommercial" title="<?php echo $this->__('Address Type') ?>" class="validate-select">
|
| 103 |
+
<option selected="selected" value="0">Commercial</option>
|
| 104 |
+
<option value="1">Residential</option>
|
| 105 |
+
</select>
|
| 106 |
+
</div>
|
| 107 |
+
</li>
|
| 108 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
| 109 |
+
<li class="wide">
|
| 110 |
+
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
|
| 111 |
+
<div class="input-box">
|
| 112 |
+
<input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 113 |
+
</div>
|
| 114 |
+
</li>
|
| 115 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
| 116 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
| 117 |
+
<li class="wide">
|
| 118 |
+
<div class="input-box">
|
| 119 |
+
<input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
| 120 |
+
</div>
|
| 121 |
+
</li>
|
| 122 |
+
<?php endfor; ?>
|
| 123 |
+
<li class="fields">
|
| 124 |
+
<div class="field">
|
| 125 |
+
<label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
| 126 |
+
<div class="input-box">
|
| 127 |
+
<input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="field">
|
| 131 |
+
<label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
| 132 |
+
<div class="input-box">
|
| 133 |
+
<select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
| 134 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
| 135 |
+
</select>
|
| 136 |
+
<script type="text/javascript">
|
| 137 |
+
//<![CDATA[
|
| 138 |
+
$('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
|
| 139 |
+
//]]>
|
| 140 |
+
</script>
|
| 141 |
+
<input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
</li>
|
| 145 |
+
<li class="fields">
|
| 146 |
+
<div class="field">
|
| 147 |
+
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
| 148 |
+
<div class="input-box">
|
| 149 |
+
<input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
<div class="field">
|
| 153 |
+
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
| 154 |
+
<div class="input-box">
|
| 155 |
+
<?php echo $this->getCountryHtmlSelect() ?>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</li>
|
| 159 |
+
</ul>
|
| 160 |
+
<input type="hidden" name="default_billing" value="1" />
|
| 161 |
+
<input type="hidden" name="default_shipping" value="1" />
|
| 162 |
+
</div>
|
| 163 |
+
<?php endif; ?>
|
| 164 |
+
<div class="fieldset">
|
| 165 |
+
<h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
|
| 166 |
+
<ul class="form-list">
|
| 167 |
+
<li class="fields">
|
| 168 |
+
<div class="field">
|
| 169 |
+
<label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
| 170 |
+
<div class="input-box">
|
| 171 |
+
<input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
<div class="field">
|
| 175 |
+
<label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
| 176 |
+
<div class="input-box">
|
| 177 |
+
<input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
|
| 178 |
+
</div>
|
| 179 |
+
</div>
|
| 180 |
+
</li>
|
| 181 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
| 182 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
| 183 |
+
</ul>
|
| 184 |
+
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
|
| 185 |
+
</div>
|
| 186 |
+
<div class="buttons-set">
|
| 187 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
| 188 |
+
<p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
| 189 |
+
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
| 190 |
+
</div>
|
| 191 |
+
<?php if (Mage::helper('checkout')->isContextCheckout()): ?>
|
| 192 |
+
<input name="context" type="hidden" value="checkout" />
|
| 193 |
+
<?php endif; ?>
|
| 194 |
+
</form>
|
| 195 |
+
<script type="text/javascript">
|
| 196 |
+
//<![CDATA[
|
| 197 |
+
var dataForm = new VarienForm('form-validate', true);
|
| 198 |
+
<?php if($this->getShowAddressFields()): ?>
|
| 199 |
+
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
| 200 |
+
<?php endif; ?>
|
| 201 |
+
//]]>
|
| 202 |
+
</script>
|
| 203 |
+
</div>
|
app/etc/modules/Ameex_ResidentialCommercial.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Ameex_ResidentialCommercial>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</Ameex_ResidentialCommercial>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>CommerceBees_ResidentialCommercial_v1</name>
|
| 4 |
+
<version>1.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="https://www.gnu.org/copyleft/gpl.html">GPL v3</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Residential/Commercial is a Magento module to indicate whether the customers' addresses are Residential or Commercial</summary>
|
| 10 |
+
<description>Residential/Commercial is a Magento module to indicate whether the customers' addresses are Residential or Commercial</description>
|
| 11 |
+
<notes>First version of Residential/Commercial module is released</notes>
|
| 12 |
+
<authors><author><name>Commerce Bees</name><user>CommerceBees</user><email>support@commercebees.com</email></author></authors>
|
| 13 |
+
<date>2014-03-25</date>
|
| 14 |
+
<time>13:22:02</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Ameex"><dir name="ResidentialCommercial"><dir name="Model"><file name="Source.php" hash="764d5fc006bff29bcb9cb728f9f3c300"/></dir><dir name="etc"><file name="config.xml" hash="6d0da7bc085eeb87e715a567a998e9fb"/></dir><dir name="sql"><dir name="residentialcommercial_setup"><file name="mysql4-install-1.0.0.php" hash="e633d4f217b48dfaf989a9abe38a76bb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="checkout"><dir name="onepage"><file name="shipping.phtml" hash="0ff10441ffffe7f6e985975c60c3a5f0"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="18dd866442451c96ddea75482b50662b"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="c3108813aa3bb6b37002abd1918aff87"/></dir></dir><dir name="customer"><dir name="form"><file name="register.phtml" hash="921d6cb47ca78ffb2d7e36d79d01d28b"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ameex_ResidentialCommercial.xml" hash="0690cf5004fad12ca1eeba1998fc241f"/></dir></target><target name="mage"><dir name="."><file name="CommerceBees_ResidentialCommercial_Extension_Guide_V1.0.pdf" hash="4108fb9e0eed4119be199320425daf09"/><file name="uninstall_ameex_residentialcommercial_module_bak.php" hash="452b8e6ecd47897e4df9166c1f75a3bc"/></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
+
</package>
|
uninstall_ameex_residentialcommercial_module_bak.php
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
require_once 'app/Mage.php';
|
| 3 |
+
umask(0);
|
| 4 |
+
Mage::app('default');
|
| 5 |
+
|
| 6 |
+
$setup = Mage::getModel('eav/entity_setup', 'core_setup');
|
| 7 |
+
$setup->startSetup();
|
| 8 |
+
$setup->removeAttribute('customer_address', 'residentialcommercial');
|
| 9 |
+
|
| 10 |
+
$setup->run("DELETE FROM {$setup->getTable('core/resource')} WHERE code='residentialcommercial_setup';
|
| 11 |
+
ALTER TABLE sales_flat_quote_address DROP COLUMN residentialcommercial;
|
| 12 |
+
ALTER TABLE sales_flat_order_address DROP COLUMN residentialcommercial;
|
| 13 |
+
");
|
| 14 |
+
$setup->endSetup();
|
| 15 |
+
|
| 16 |
+
echo 'Residential/Commercial module has been uninstalled completely';
|
