Modify Buy Button code
We need to modify the submit function attached to the Buy ("Acheter") button in our Lightspeed shop to do additional validations.
Unfortunately I believe the checkout script managing the submit function is standardized for all shops and we don't directly have access to it. It's located at https://cdn.shoplightspeed.com/assets/checkout/checkout.js?2021-06-28?10
Is there any way to REPLACE the submit function here with our own? Which would be 99% the same but with more validations up front.
We already have access to customizable JS files in the project (like global.js). However we fear anything we do in them will be overwritten by the checkout script.
(My first attempt at this problem consisted in adding another function in the onclick before $('#gui-form').submit()) but the onclick attribute gets reset automatically).
Any help greatly appreciated