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

  • 相关阅读:
    matlab : Nelder mead simplex 单纯形直接搜索算法;
    python: 基本知识(二)
    vim: 基本知识;
    C++: 带参数回调函数和不带参数的回调函数;
    android studio DrawerLayout(官方侧滑菜单)的简单使用1
    Android studio DrawerLayout示例
    android studio ViewPager
    团队开发之任务认领
    android studio ViewPager的简单使用
    Android studio 菜单(Menu)
  • 原文地址:https://www.cnblogs.com/magento-maijindou/p/5973012.html
Copyright © 2011-2022 走看看