首页>Magento>source

如何从结帐页面更改"不需要"的邮政编码所需字段? 我更改了app / design / frontend / base / default / template / persistent / checkout / onepage / billing.phtml中的106-111行

<div class="field">
                    <label for="billing:postcode"><?php echo $this->__('Zip/Postal Code') ?></label>
                    <div class="input-box">
                        <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php// echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
                    </div>
                </div>

此外,我已从文件"app / code / core / Mage / Customer / Model / Address / Abstract.php"中删除了这些行

$_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
    if (!in_array($this->getCountryId(), $_havingOptionalZip)
        && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')
    ) {
        $this->addError(Mage::helper('customer')->__('Please enter the zip/postal code.'));
    }

但它没有完全改变那个不需要的领域.因为当我下订单时,它会显示一条消息

"Zip/Postal Code" is a required value.

  • magento2:Magento 2:如何停止php bin / magento设置进程:backup --db
  • Magento 21:产品集合的分页