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中这些字段('邮编')。

  • 相关阅读:
    redis搭建集群
    redis搭建主从
    redis与python交互
    redis数据操作篇
    redis配置篇
    node 淘宝镜像
    java 深copy
    springmvc配置访问静态文件
    centos 启动 oracle
    List 分隔多次执行 且在同一个事物当中
  • 原文地址:https://www.cnblogs.com/magento-maijindou/p/5973012.html
Copyright © 2011-2022 走看看