1

Is it possible to remove the address street city field from billing information in checkout page in magento?

As already try in abstract page but it's not done, then to try in database to change eav_attribute but not done. Would you please give some information how to remove these particular compulsory field from this billing information? Please give me suggestion

1

You have to remove the required-class from each of this field.you can you jquery

jQuery(document).ready(function(){
    jQuery('#billing\\:street1').removeClass('required-entry');
    jQuery('#billing\\:city').removeClass('required-entry');
    jQuery('#billing\\:country_id').removeClass('required-entry');
    jQuery('#billing\\:country_id').removeClass('validate-select');
}

in the billing.phtml from checkout/onepage/

1

Sunil Kumar Nayak,it is too complex process to remove this field.I suggestion is to pass this fields values using hidden field and hidden field value like -

You need to do some css works which will hide this fields value

Just like

<div class="field" style="display:none">
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="-" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" value="-" />
</div>
</div>
1

You cannot only remove js validation, there is backend address validation which hardcode to check some fields in address must not be empty.

app/code/core/Mage/Customer/Model/Address/Abstract.php

 protected function _basicCheck()
{
    if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
        $this->addError(Mage::helper('customer')->__('Please enter the first name.'));
    }

    if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
        $this->addError(Mage::helper('customer')->__('Please enter the last name.'));
    }

    if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
        $this->addError(Mage::helper('customer')->__('Please enter the street.'));
    }

    if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) {
        $this->addError(Mage::helper('customer')->__('Please enter the city.'));
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.