Cs-Cart Scroll To Element With Fixed Header

Hello,

CS-Cart auto-scrolls the window to an input field if there is a validation error. The design of my store uses a fixed header set to

position: fixed; /* in CSS */. 

My problem is that when Scroll to Element is called by CS-Cart, the input element gets positioned underneath the header. How would I fix this so that the element is shown just below the header (header height is 80px)?

Thank you for your contribution.

Would anyone guide me on fixing this issue? Which file should I edit?

Find the scrollToElm function in the js/tygh/core.js file and decrease the value of the elm_offset variable by fixed value (e.g. 200px)

Thank you eComLabs. I will give a try. Can this be achieved without changing core files? I don't want to lose my changes after software upgrade.

Thank you eComLabs. I will give a try. Can this be achieved without changing core files? I don't want to lose my changes after software upgrade.

Yes, you can use hook in the mentioned function.