Skip to main content

Custom server side validation

5 years 11 months ago - 5 years 11 months ago #327053 by luckystrike
-- HikaShop version -- : 4.4.0
-- Joomla version -- : ‎3.9.19
-- PHP version -- : 7.2.34

Hey,

I need help on the Checkout page. There is a registration form for guests, with company name, and VAT number fields (sub_block_login_registration.php). The VAT number should be required, but only if the company name is filled with something. Where can I find this file, that validates the form and returns with an error message?

Thank You
Last edit: 5 years 11 months ago by luckystrike.

Please Log in or Create an account to join the conversation.

5 years 11 months ago #327056 by nicolas
Hi,

I don't recommend to directly edit the core files of HikaShop.
I would rather recommend a small plugin of the group "hikashop" and implement the triggers onBeforeAddressCreate(&$address, &$do) and onBeforeAddressUpdate(&$address, &$do).
In these functions, you can just set $do to false and use $app->enqueueMessage() to display an error message to the user based on the data you have in $address.
Here is a tutorial on how to develop joomla plugins:
docs.joomla.org/Portal:Plugin_Development

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum