zoukankan      html  css  js  c++  java
  • 在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中这些字段('邮编')。

  • 相关阅读:
    MyBatis的创建过程
    Mybatis框架的搭建步骤
    jquer选择器
    JavaScrip中构造函数、prototype原型对象、实例对象三者之间的关系
    java_集合_ArrayList
    /WEB-INF/jsp/userlist.jsp (line: [48], column: [4]) According to TLD or attribute directive in tag file, attribute [items] does not accept any expressions
    初学Spring框架——入门
    动态SQL
    JQuery高级——遍历
    Jquery简单介绍
  • 原文地址:https://www.cnblogs.com/magento-maijindou/p/5973012.html
Copyright © 2011-2022 走看看