So as my title suggests..
I'm familiar with how to do this in billing on the one page checkout (
- make attributes as not required in
eav attributes
table in the database, - copy the
Customer/Model/Address.php
file editing out the relevant validation in the method 'validate').
However this has not helped in the paypal express review page and it will not allow the user to checkout stating:
"Incorrect billing address. CITY field is required"
There must be a similar file (to Abstract.php
) that validates the data before submission but I just cannot track it down. Anyone who can or already knows please heed the call – the community may well benefit from this as well as myself. Any further info neede let me know. Thanks
Best Answer
I hate posting answers to my own questions but it seems that as the one who has need of it most pressingly I have gone the distance here.. as is too often the case..
So after trying numerous techniques including:
1) making attributes as not required in the
eav attributes
table in the database;2) programatically adding these required fields to the database upon billing update (with event)
The best that I have come up with that works (very well) is to create hidden fields for any fields that are required but not relevant - in my case
city
,region
andpostcode
- and include them inside the form. The easiest way to do this I believe is to create a function for this in a custom module file like so (changing$inputFields_arr
to correspond to the required fields you wish to ignore):Then call this like this:
<?php echo $moduleFile->getRequiredNotRequestedInputs('billing'); // set city, postcode, etc ?>
..from whatever point you want (where
$moduleFile
is the file you stored the above function in). In my case I've called this in:I know that there are those out there that will want to do this the quick and nasty way (and that is your perogative) by putting the hidden fields directly into a local front-end file (and overriding the core) but after learning to use custom modules with all that you can it will not only help you to update (a well-heard sermon) it will keep things tidy and for me that is more than half the battle. Hope this is helpful to others.