Posted: September 14, 2016 at 4:56 am
|
HI, Follow up to https://eventespresso.com/topic/sagepay-changing-required-fields/ The solution on https://github.com/eventespresso/ee-code-snippet-library/blob/master/checkout/mn_billing_form_zip_optional_for_sagepay.php no longer works. On the Card details page , the Postcode is still required. Any ideas? Regards alan |
Hi Alan, Where do you currently have that code on your site? The reason I ask is I have just added the code to a test site using the SagePay add-on and it set the zip field to longer be required so it could be a load order issue. |
|
|
HI Tony, Its in my child themes functions file. Rgds Alan |
Hmm, strange. On testing that function it works fine in a child theme. Can you try creating a Custom Functions Plugin and see if works for you there? |
|
|
I just tried to install the Custom Functions PLugin but it conflicts with SendGrid SO I have disabled it again. I’m not able to test anymore today so will come back to any replies on Monday Thanks Alan |
September 15, 2016 at 10:15 am
That will only happen if the functions within your custom plugin de-declare the ‘wp_mail()’ function, if you’ve followed the steps on the above link that should not be the case. If you’d like to post the contents of you custom plugin I can take a look, you’ll need to create a gist or use something like pastebin then post the link here for us to view. |
|
|
September 15, 2016 at 10:21 am Hi Tony, I got error when I activated the custom functions plugin before adding any functions. Rgds Alan |
That doesn’t really make any sense, although its not that I don’t believe you. It sounds like the sendgrid plugin is throwing a false positive when the plugin is activated as if all you have is a blank plugin with no functions it can’t override wp_mail(). Can you send me login details so I can take a quick look? If so please use: |
|
|
Apologies Tony, I misread your reply. I installed a plugin called Custom Functions Plugin which through the error!! I’ll try the correct method you suggested Monday. Rgds Alan |
September 16, 2016 at 11:13 am Hi Alan, You can also create a site specific plugin for your site. We have a tutorial for that here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ — |
|
|
Hi Lorenzo, No luck with the plugin solution. Its still saying Postcode required on SagePay Card details page. The code I added to custom plugin was Regards Alan |
Hi Alan, Can you link me to an event I can run a test registration on please? |
|
|
|
The function is running on your site, you can tell as Postcode no longer has the * next to the label indicating it is no longer set as require within EE. However, the field has the aria-required attribute set to true – http://take.ms/UR5qX It looks like that is what is causing the validation on the field but I don’t think that is added by EE itself. I have requested some feedback from one of our developers on this and will post any feedback they provide. |
|
|
September 29, 2016 at 12:55 pm Tony, I’ve change code in EE_Billing_Attendee_Info_Form.form.php to EE_Text_Input( array( ‘required’=>FALSE and it works. Could this be done elsewhere? Rgds Alan |
OK, found the problem. So you’ve changed this line:
to be:
Is that right? That’s almost the same as what the filter is doing, but the filter does it only for the instance of EE_Billing_Attendee_Info_Form used for SagePay and not all instances. It’s an issue with the JS validation and will need a fix pushed to live, I will update this thread when it is pushed. |
|
|
Thats Correct Tony. Thanks for your help Alan |
Hi Alan, The fix for this was pushed within 4.9.16.p When you update your modification above will be removed however the filter above should now work as expected. |
|
|
Thanks Tony |
You’re most welcome. If you run into any problems please do let me know. |
|
The support post ‘SagePay – Changing required fields – Postcode’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.