Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Cs-Cart Scroll To Element With Fixed Header Rate Topic   - - - - -

 
  • alaa
  • Advanced Member
  • Members
  • Join Date: 18-Mar 18
  • 145 posts

Posted 25 February 2019 - 07:32 AM #1

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. 

 

 


 
  • alaa
  • Advanced Member
  • Members
  • Join Date: 18-Mar 18
  • 145 posts

Posted 03 March 2019 - 07:54 AM #2

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19301 posts

Posted 04 March 2019 - 05:24 AM #3

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)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alaa
  • Advanced Member
  • Members
  • Join Date: 18-Mar 18
  • 145 posts

Posted 04 March 2019 - 08:22 AM #4

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. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19301 posts

Posted 04 March 2019 - 02:11 PM #5

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.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.