On 3/31/2021 at 4:18 PM, user900 said:
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],
Instead of to comment the line, you can set the required value to false, the same with the state field and the country field. The only one field that is REQUIRED by force is postcode. It will be required, no matter what you do.
So, you only may add some CSS rules to hide these fields.