在magento1.9结账地址中删除验证
类覆盖的方法: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中这些字段('邮编')。
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步