Version Notes
remoe last name for chinacustomer
Download this release
Release Info
Developer | Minglong Li |
Extension | Achang_Chinacustomer |
Version | 0.2.0 |
Comparing to | |
See all releases |
Version 0.2.0
- app/code/local/Achang/Chinacustomer/Helper/Data.php +14 -0
- app/code/local/Achang/Chinacustomer/Model/Customer/Customer.php +75 -0
- app/code/local/Achang/Chinacustomer/Model/Sales/Quote/Address.php +66 -0
- app/code/local/Achang/Chinacustomer/etc/config.xml +57 -0
- app/code/local/Achang/Chinacustomer/sql/chinacustomer_setup/mysql4-install-0.1.0.php +30 -0
- app/code/local/Achang/Chinacustomer/sql/chinacustomer_setup/mysql4-upgrade-0.1.0-0.2.0.php +46 -0
- app/code/local/Achang/RemoveBilling/Block/Checkout/Onepage.php +30 -0
- app/code/local/Achang/RemoveBilling/Helper/Data.php +14 -0
- app/code/local/Achang/RemoveBilling/etc/config.xml +31 -0
- app/design/frontend/default/default/template/customer/widget/name.phtml +103 -0
- app/etc/modules/Achang_Chinacustomer.xml +10 -0
- package.xml +18 -0
app/code/local/Achang/Chinacustomer/Helper/Data.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @copyright Achang WebDev
|
6 |
+
* @link http://www.achang.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
class Achang_Chinacustomer_Helper_Data extends Mage_Core_Helper_Abstract{}
|
14 |
+
|
app/code/local/Achang/Chinacustomer/Model/Customer/Customer.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @copyright Achang WebDev
|
6 |
+
* @link http://www.achang.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
class Achang_Chinacustomer_Model_Customer_Customer extends Mage_Customer_Model_Customer
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
protected function _beforeSave()
|
16 |
+
{
|
17 |
+
parent::_beforeSave();
|
18 |
+
$this->setLastname('');
|
19 |
+
return $this;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Validate customer attribute values.
|
24 |
+
* For existing customer password + confirmation will be validated only when password is set (i.e. its change is requested)
|
25 |
+
*
|
26 |
+
* @return bool
|
27 |
+
*/
|
28 |
+
public function validate()
|
29 |
+
{
|
30 |
+
$errors = array();
|
31 |
+
if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) {
|
32 |
+
$errors[] = Mage::helper('customer')->__('The first name cannot be empty.');
|
33 |
+
}
|
34 |
+
|
35 |
+
if (false && !Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
|
36 |
+
$errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
|
37 |
+
}
|
38 |
+
|
39 |
+
if (!Zend_Validate::is($this->getEmail(), 'EmailAddress')) {
|
40 |
+
$errors[] = Mage::helper('customer')->__('Invalid email address "%s".', $this->getEmail());
|
41 |
+
}
|
42 |
+
|
43 |
+
$password = $this->getPassword();
|
44 |
+
if (!$this->getId() && !Zend_Validate::is($password , 'NotEmpty')) {
|
45 |
+
$errors[] = Mage::helper('customer')->__('The password cannot be empty.');
|
46 |
+
}
|
47 |
+
if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
|
48 |
+
$errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
|
49 |
+
}
|
50 |
+
$confirmation = $this->getConfirmation();
|
51 |
+
if ($password != $confirmation) {
|
52 |
+
$errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
|
53 |
+
}
|
54 |
+
|
55 |
+
$entityType = Mage::getSingleton('eav/config')->getEntityType('customer');
|
56 |
+
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'dob');
|
57 |
+
if ($attribute->getIsRequired() && '' == trim($this->getDob())) {
|
58 |
+
$errors[] = Mage::helper('customer')->__('The Date of Birth is required.');
|
59 |
+
}
|
60 |
+
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'taxvat');
|
61 |
+
if ($attribute->getIsRequired() && '' == trim($this->getTaxvat())) {
|
62 |
+
$errors[] = Mage::helper('customer')->__('The TAX/VAT number is required.');
|
63 |
+
}
|
64 |
+
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'gender');
|
65 |
+
if ($attribute->getIsRequired() && '' == trim($this->getGender())) {
|
66 |
+
$errors[] = Mage::helper('customer')->__('Gender is required.');
|
67 |
+
}
|
68 |
+
|
69 |
+
if (empty($errors)) {
|
70 |
+
return true;
|
71 |
+
}
|
72 |
+
return $errors;
|
73 |
+
}
|
74 |
+
|
75 |
+
}
|
app/code/local/Achang/Chinacustomer/Model/Sales/Quote/Address.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @copyright Achang WebDev
|
6 |
+
* @link http://www.achang.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
class Achang_Chinacustomer_Model_Sales_Quote_Address extends Mage_Sales_Model_Quote_Address
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Validate address attribute values
|
15 |
+
*
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
public function validate()
|
19 |
+
{
|
20 |
+
$errors = array();
|
21 |
+
$helper = Mage::helper('customer');
|
22 |
+
$this->implodeStreetAddress();
|
23 |
+
if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
|
24 |
+
$errors[] = $helper->__('Please enter the first name.');
|
25 |
+
}
|
26 |
+
|
27 |
+
if (false && !Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
|
28 |
+
$errors[] = $helper->__('Please enter the last name.');
|
29 |
+
}
|
30 |
+
|
31 |
+
if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
|
32 |
+
$errors[] = $helper->__('Please enter the street.');
|
33 |
+
}
|
34 |
+
|
35 |
+
if (!Zend_Validate::is($this->getCity(), 'NotEmpty') && !Zend_Validate::is($this->getCityId(), 'NotEmpty')) {
|
36 |
+
$errors[] = $helper->__('Please enter the city.');
|
37 |
+
}
|
38 |
+
|
39 |
+
if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty') && !Zend_Validate::is($this->getCityId(), 'NotEmpty')) {
|
40 |
+
$errors[] = $helper->__('Please enter the right telephone number.');
|
41 |
+
}
|
42 |
+
|
43 |
+
/* if (!Zend_Validate::is($this->getTelephone(), 'Zend_Validate_StringLength',array('min' => 11,'max' =>11)) || !Zend_Validate::is($this->getTelephone(), 'Zend_Validate_Digits')) {
|
44 |
+
$errors[] = $helper->__('Please enter the right telephone number.');
|
45 |
+
}*/
|
46 |
+
|
47 |
+
$_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
|
48 |
+
if (!in_array($this->getCountryId(), $_havingOptionalZip) && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')) {
|
49 |
+
$errors[] = $helper->__('Please enter the zip/postal code.');
|
50 |
+
}
|
51 |
+
|
52 |
+
if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
|
53 |
+
$errors[] = $helper->__('Please enter the country.');
|
54 |
+
}
|
55 |
+
|
56 |
+
if ($this->getCountryModel()->getRegionCollection()->getSize()
|
57 |
+
&& !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) {
|
58 |
+
$errors[] = $helper->__('Please enter the state/province.');
|
59 |
+
}
|
60 |
+
|
61 |
+
if (empty($errors) || $this->getShouldIgnoreValidation()) {
|
62 |
+
return true;
|
63 |
+
}
|
64 |
+
return $errors;
|
65 |
+
}
|
66 |
+
}
|
app/code/local/Achang/Chinacustomer/etc/config.xml
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Achang_Chinacustomer>
|
5 |
+
<version>0.2.0</version>
|
6 |
+
</Achang_Chinacustomer>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<sales>
|
11 |
+
<rewrite>
|
12 |
+
<quote_address>Achang_Chinacustomer_Model_Sales_Quote_Address</quote_address>
|
13 |
+
</rewrite>
|
14 |
+
</sales>
|
15 |
+
<customer>
|
16 |
+
<rewrite>
|
17 |
+
<customer>Achang_Chinacustomer_Model_Customer_Customer</customer>
|
18 |
+
</rewrite>
|
19 |
+
</customer>
|
20 |
+
<chinacustomer>
|
21 |
+
<class>Achang_Chinacustomer_Model</class>
|
22 |
+
<resourceModel>chinacustomer_mysql4</resourceModel>
|
23 |
+
</chinacustomer>
|
24 |
+
</models>
|
25 |
+
<helpers>
|
26 |
+
<chinacustomer>
|
27 |
+
<class>Achang_Chinacustomer_Helper</class>
|
28 |
+
</chinacustomer>
|
29 |
+
</helpers>
|
30 |
+
<blocks>
|
31 |
+
<chinacustomer>
|
32 |
+
<class>Achang_Chinacustomer_Block</class>
|
33 |
+
</chinacustomer>
|
34 |
+
</blocks>
|
35 |
+
<resources>
|
36 |
+
<chinacustomer_setup>
|
37 |
+
<setup>
|
38 |
+
<module>Achang_Chinacustomer</module>
|
39 |
+
<class>Mage_Eav_Model_Entity_Setup</class>
|
40 |
+
</setup>
|
41 |
+
<connection>
|
42 |
+
<use>core_setup</use>
|
43 |
+
</connection>
|
44 |
+
</chinacustomer_setup>
|
45 |
+
<chinacustomer_write>
|
46 |
+
<connection>
|
47 |
+
<use>core_write</use>
|
48 |
+
</connection>
|
49 |
+
</chinacustomer_write>
|
50 |
+
<chinacustomer_read>
|
51 |
+
<connection>
|
52 |
+
<use>core_read</use>
|
53 |
+
</connection>
|
54 |
+
</chinacustomer_read>
|
55 |
+
</resources>
|
56 |
+
</global>
|
57 |
+
</config>
|
app/code/local/Achang/Chinacustomer/sql/chinacustomer_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @copyright Achang WebDev
|
6 |
+
* @link http://www.achang.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
$installer = $this;
|
11 |
+
$installer->startSetup();
|
12 |
+
|
13 |
+
/*
|
14 |
+
$eavConfig = Mage::getSingleton('eav/config');
|
15 |
+
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'dob');
|
16 |
+
$oAttribute->setData('is_visible', true);
|
17 |
+
$oAttribute->save();
|
18 |
+
*/
|
19 |
+
|
20 |
+
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'gender');
|
21 |
+
$oAttribute->setData('is_visible', true);
|
22 |
+
$oAttribute->save();
|
23 |
+
|
24 |
+
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'lastname');
|
25 |
+
$oAttribute->setData('is_required',false );
|
26 |
+
$oAttribute->save();
|
27 |
+
|
28 |
+
|
29 |
+
$installer->endSetup();
|
30 |
+
|
app/code/local/Achang/Chinacustomer/sql/chinacustomer_setup/mysql4-upgrade-0.1.0-0.2.0.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @copyright Achang WebDev
|
6 |
+
* @link http://www.achang.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
$installer = $this;
|
11 |
+
$installer->startSetup();
|
12 |
+
|
13 |
+
|
14 |
+
$eavConfig = Mage::getSingleton('eav/config');
|
15 |
+
|
16 |
+
$attributes = array(
|
17 |
+
'prefix',
|
18 |
+
'middlename',
|
19 |
+
'lastname',
|
20 |
+
'suffix',
|
21 |
+
'taxvat',
|
22 |
+
'fax',
|
23 |
+
);
|
24 |
+
|
25 |
+
$defaultUsedInForms = array(
|
26 |
+
);
|
27 |
+
|
28 |
+
foreach ($attributes as $attributeCode) {
|
29 |
+
$attribute = $eavConfig->getAttribute('customer', $attributeCode);
|
30 |
+
if (!$attribute) {
|
31 |
+
continue;
|
32 |
+
}
|
33 |
+
$where = array('attribute_id=?' => $attribute->getId());
|
34 |
+
$installer->getConnection()->delete($installer->getTable('customer/form_attribute'), $where);
|
35 |
+
}
|
36 |
+
|
37 |
+
foreach ($attributes as $attributeCode) {
|
38 |
+
$attribute = $eavConfig->getAttribute('customer_address', $attributeCode);
|
39 |
+
if (!$attribute) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
$where = array('attribute_id=?' => $attribute->getId());
|
43 |
+
$installer->getConnection()->delete($installer->getTable('customer/form_attribute'), $where);
|
44 |
+
}
|
45 |
+
|
46 |
+
$installer->endSetup();
|
app/code/local/Achang/RemoveBilling/Block/Checkout/Onepage.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @file Onepage.php
|
6 |
+
* @author Owen <owen@achang.com>
|
7 |
+
* @copyright Achang WebDev
|
8 |
+
* @link http://www.achang.com
|
9 |
+
*
|
10 |
+
* Date Time: 13-8-2 上午10:43
|
11 |
+
*/
|
12 |
+
|
13 |
+
class Achang_RemoveBilling_Block_Checkout_Onepage extends Mage_Checkout_Block_Onepage
|
14 |
+
{
|
15 |
+
public function getSteps()
|
16 |
+
{
|
17 |
+
$steps = array();
|
18 |
+
|
19 |
+
if (!$this->isCustomerLoggedIn()) {
|
20 |
+
$steps['login'] = $this->getCheckout()->getStepData('login');
|
21 |
+
}
|
22 |
+
|
23 |
+
$stepCodes = array('billing', 'shipping_method', 'payment', 'review','shipping');
|
24 |
+
|
25 |
+
foreach ($stepCodes as $step) {
|
26 |
+
$steps[$step] = $this->getCheckout()->getStepData($step);
|
27 |
+
}
|
28 |
+
return $steps;
|
29 |
+
}
|
30 |
+
}
|
app/code/local/Achang/RemoveBilling/Helper/Data.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by Achang WebDev
|
4 |
+
*
|
5 |
+
* @file ${FILE_NAME}
|
6 |
+
* @author Owen <owen@achang.com>
|
7 |
+
* @copyright Achang WebDev
|
8 |
+
* @link http://www.achang.com
|
9 |
+
*
|
10 |
+
* Date Time: 13-8-2 上午10:38
|
11 |
+
*/
|
12 |
+
class Achang_RemoveBilling_Helper_Data extends Mage_Core_Helper_Abstract {
|
13 |
+
|
14 |
+
}
|
app/code/local/Achang/RemoveBilling/etc/config.xml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Achang_RemoveBilling>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Achang_RemoveBilling>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<removebilling>
|
11 |
+
<class>Achang_RemoveBilling_Model</class>
|
12 |
+
</removebilling>
|
13 |
+
|
14 |
+
</models>
|
15 |
+
<blocks>
|
16 |
+
<removebilling>
|
17 |
+
<class>Achang_RemoveBilling_Block</class>
|
18 |
+
</removebilling>
|
19 |
+
<checkout>
|
20 |
+
<rewrite>
|
21 |
+
<onepage>Achang_RemoveBilling_Block_Checkout_Onepage</onepage>
|
22 |
+
</rewrite>
|
23 |
+
</checkout>
|
24 |
+
</blocks>
|
25 |
+
<helpers>
|
26 |
+
<removebilling>
|
27 |
+
<class>Achang_RemoveBilling_Helper</class>
|
28 |
+
</removebilling>
|
29 |
+
</helpers>
|
30 |
+
</global>
|
31 |
+
</config>
|
app/design/frontend/default/default/template/customer/widget/name.phtml
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
/**
|
28 |
+
USAGE:
|
29 |
+
|
30 |
+
Simple:
|
31 |
+
|
32 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')
|
33 |
+
->setObject($this->getAddress())
|
34 |
+
->toHtml() ?>
|
35 |
+
|
36 |
+
For checkout/onepage/shipping.phtml:
|
37 |
+
|
38 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')
|
39 |
+
->setObject($this->getAddress())
|
40 |
+
->setFieldIdFormat('shipping:%s')
|
41 |
+
->setFieldNameFormat('shipping[%s]')
|
42 |
+
->setFieldParams('onchange="shipping.setSameAsBilling(false);"')
|
43 |
+
->toHtml() ?>
|
44 |
+
*/
|
45 |
+
/* @var $this Mage_Customer_Block_Widget_Name */
|
46 |
+
?>
|
47 |
+
<div class="<?php echo $this->getContainerClassName()?>">
|
48 |
+
<?php if ($this->showPrefix()): ?>
|
49 |
+
<div class="field name-prefix">
|
50 |
+
<label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('prefix') ?></label>
|
51 |
+
<div class="input-box">
|
52 |
+
<?php if ($this->getPrefixOptions() === false): ?>
|
53 |
+
<input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> />
|
54 |
+
<?php else: ?>
|
55 |
+
<select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?>>
|
56 |
+
<?php foreach ($this->getPrefixOptions() as $_option): ?>
|
57 |
+
<option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
|
58 |
+
<?php endforeach; ?>
|
59 |
+
</select>
|
60 |
+
<?php endif; ?>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<?php endif; ?>
|
64 |
+
<div class="field name-firstname">
|
65 |
+
<label for="<?php echo $this->getFieldId('firstname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('firstname') ?></label>
|
66 |
+
<div class="input-box">
|
67 |
+
<input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> />
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
<?php if ($this->showMiddlename()): ?>
|
71 |
+
<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?>
|
72 |
+
<div class="field name-middlename">
|
73 |
+
<label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label>
|
74 |
+
<div class="input-box">
|
75 |
+
<input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> />
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
<?php endif; ?>
|
79 |
+
<!--
|
80 |
+
<div class="field name-lastname">
|
81 |
+
<label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('lastname') ?></label>
|
82 |
+
<div class="input-box">
|
83 |
+
<input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> />
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
-->
|
87 |
+
<?php if ($this->showSuffix()): ?>
|
88 |
+
<div class="field name-suffix">
|
89 |
+
<label for="<?php echo $this->getFieldId('suffix')?>"<?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('suffix') ?></label>
|
90 |
+
<div class="input-box">
|
91 |
+
<?php if ($this->getSuffixOptions() === false): ?>
|
92 |
+
<input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> />
|
93 |
+
<?php else: ?>
|
94 |
+
<select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?>>
|
95 |
+
<?php foreach ($this->getSuffixOptions() as $_option): ?>
|
96 |
+
<option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
|
97 |
+
<?php endforeach; ?>
|
98 |
+
</select>
|
99 |
+
<?php endif; ?>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
<?php endif; ?>
|
103 |
+
</div>
|
app/etc/modules/Achang_Chinacustomer.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Achang_Chinacustomer>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
<depends>Mage_Customer</depends>
|
8 |
+
</Achang_Chinacustomer>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Achang_Chinacustomer</name>
|
4 |
+
<version>0.2.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>去除lastname</summary>
|
10 |
+
<description>去除lastname remove last name</description>
|
11 |
+
<notes>remoe last name for chinacustomer</notes>
|
12 |
+
<authors><author><name>achang</name><user>achang</user><email>magento@achang.com</email></author></authors>
|
13 |
+
<date>2013-08-02</date>
|
14 |
+
<time>05:47:39</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Achang"><dir name="Chinacustomer"><dir name="Helper"><file name="Data.php" hash="d925deb4a5640dae570b450245a7d66c"/></dir><dir name="Model"><dir name="Customer"><file name="Customer.php" hash="047a539b90769c9dbb7668d211fa93e6"/></dir><dir name="Sales"><dir name="Quote"><file name="Address.php" hash="614693895ef8f9543c24d9312719a4b1"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="fc39a31d71e1c1b7cacb21c5524304e9"/></dir><dir name="sql"><dir name="chinacustomer_setup"><file name="mysql4-install-0.1.0.php" hash="a37f348d689fc37ab82d2c7ca7088201"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="b6e8a3f8272e1b9fbf0e6d0338fa0b10"/></dir></dir></dir><dir name="RemoveBilling"><dir name="Block"><dir name="Checkout"><file name="Onepage.php" hash="7f88cee677b265ec8fe66a08cac8186d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="530adbd6463bdb7ad07044d1bcd62a25"/></dir><dir name="etc"><file name="config.xml" hash="3de0aa4ee23392a4a49d2f8c8ca39c91"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Achang_Chinacustomer.xml" hash="8090dbd13b7f8bd4f49fbb378352f255"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="customer"><dir name="widget"><file name="name.phtml" hash="4f21134cbc62771531e8b495290bf3c0"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|