类覆盖的方法:Mage_Customer_Helper_Address :: getAttributeValidationClass($ attributeCode)喜欢的东西:
public function getAttributeValidationClass($attributeCode) { /** @var $attribute Mage_Customer_Model_Attribute */ $attribute = isset($this->_attributes[$attributeCode]) ? $this->_attributes[$attributeCode] : Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode); if (in_array($attributeCode, array('firstname', 'lastname', 'country'))){ $class = $attribute ? $attribute->getFrontend()->getClass() : ''; } if (in_array($attributeCode, array('firstname', 'middlename', 'lastname', 'prefix', 'suffix', 'taxvat'))) { if ($class && !$attribute->getIsVisible()) { $class = ''; // address attribute is not visible thus its validation rules are not applied } /** @var $customerAttribute Mage_Customer_Model_Attribute */ $customerAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode); $class .= $customerAttribute && $customerAttribute->getIsVisible() ? $customerAttribute->getFrontend()->getClass() : ''; $class = implode(' ', array_unique(array_filter(explode(' ', $class)))); } return $class; }
之后,扩展应用程序/设计/前端/ RWD /默认/模板/永久/签/ onepage / billing.phtml应用程序/设计/前端/ RWD /默认/模板/永久/签/ onepage / shipping.phtml
在自己的自定义主题模板,并删除所需的*和像场邮编解除呼叫被$ this->帮手(“客户/地址') - > getAttributeValidationClass在HTML中这些字段('邮编')。