Jump to content

Edit History

user900

user900

 

Hi guys,

Im trying to remove some fields form the checkout page (specifically: postcode, city, address 2)

First was a problem to remove the city field,  I went to: International / Locations them I selected country and when I tried to remove the field "city" I couldn't, PrestaShop said the following message:

"The city field (in tab Address) is required"

 

So after some google, I found out I need to modify:  classes/Address.php

I commented the whole line 134 that said:

'city' => ['type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64],

 

The problem persisted, and I still got the same message, so I edit the file classes/AddressFormat.php

I commented the line 63 that said "city":

    /** @var array Default required form fields list */
    public static $requireFormFieldsList = [
        'firstname',
        'lastname',
        'address1',
        // 'city',
        'Country:name',
    ];


Now, I finally was available to remove the field. But the issue still persit. Let me explain my self:

If you go to the checkout page, you can see the postal code and city field.

1296605711_Screenshot2021-03-31at10_14_26p.m..thumb.jpg.499c436f32673d061e4ecaa536d3e1bc.jpg

 

 

But, when I select the country, everything looks like is supposed to look.

862842549_Screenshot2021-03-31at10_14_36p.m..thumb.jpg.9a74ce48a65d3b2afee7f59abcd8b790.jpg

 

 


Any idea? How can I do, so i can remove the postcode and the city field?

Btw, my cache is off, but, I had cleaned my cache (in the performance page) and also I cleaned the cache on my browser. Also, I deleted this folder: /var/cache/prod/

Thanks guys

I use Prestashop: 1.7.7.2

Screenshot 2021-03-31 at 10.06.59 p.m..jpg

Screenshot 2021-03-31 at 10.00.57 p.m..jpg

user900

user900

 

Hi guys,

Im trying to remove some fields form the checkout page (specifically: postcode, city, address 2)

First was a problem to remove the city field,  I went to: International / Locations them I selected country and when I tried to remove the field "city" I couldn't, PrestaShop said the following message:

"The city field (in tab Address) is required"

 

So after some google, I found out I need to modify:  classes/Address.php

I commented the whole line 134 that said:

'city' => ['type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64],

 

The problem persisted, and I still got the same message, so I edit the file classes/AddressFormat.php

I commented the line 63 that said "city":

    /** @var array Default required form fields list */
    public static $requireFormFieldsList = [
        'firstname',
        'lastname',
        'address1',
        // 'city',
        'Country:name',
    ];


Now, I finally was available to remove the field. But the issue still persit. Let me explain my self:

If you go to the checkout page, you can see the postal code and city field.

1296605711_Screenshot2021-03-31at10_14_26p.m..thumb.jpg.499c436f32673d061e4ecaa536d3e1bc.jpg

 

 

But, when I select the country, everything looks like is supposed to look.

862842549_Screenshot2021-03-31at10_14_36p.m..thumb.jpg.9a74ce48a65d3b2afee7f59abcd8b790.jpg

 

 


Any idea?

Btw, my cache is off, but, I had cleaned my cache (in the performance page) and also I cleaned the cache on my browser. Also, I deleted this folder: /var/cache/prod/

Thanks guys

I use Prestashop: 1.7.7.2

Screenshot 2021-03-31 at 10.06.59 p.m..jpg

Screenshot 2021-03-31 at 10.00.57 p.m..jpg

×
×
  • Create New...