Home Forums WoodMart support forum Mobile sticky add to cart not scrolling to top after repositioning title

Mobile sticky add to cart not scrolling to top after repositioning title

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #491779

    Thomas
    Participant

    Hi,

    We’ve made many customizations to the theme. Somehow we can’t get the sticky add to cart on mobile working to scroll to the top of the page. The probem started when we repositioned the title out of the .summary-inner class which StickyAddToCart.js is referring to (see printscreen ‘reposition title’).

    We’ve tried many things such as changing the class in StickyAddToCart.js (see printscreen ‘changed css classes’), but unfortunately it didn’t work (it doesn’t change anything whatsoever).

    Apart from the above we also get a console log error (see attachment) but we are not technical enough to understand it. What does this mean and is this a theme bug?

    What we would like is the sticky add to cart on mobile to jump to our price or klarna message (the same as how it orignally worked to scroll to the top, title of the page). How can we fix that?

    Attachments:
    You must be logged in to view attached files.
    #491783

    Thomas
    Participant

    Update: so we found a temporary solution. We’ve got the sticky add to cart working and scrolling to the top when we edited the minifed version: StickyAddToCart.min.js. That leads us to two questions:

    1. Is it reliable to edit the .min.js version?
    2. If yes to above question: How can we get StickyAddToCart.min.js to work when added in the same folder of the child theme? Because now it doesn’t work.

    #491846

    Artem Temos
    Keymaster

    Hello,

    All the customizations made in the theme files are at your own risk. Our support doesn’t cover any issues caused by changes in the theme code.
    To edit this file in the child theme you need to remove the parent theme file and load a different file from the child theme. You need to use WordPress functions for that.

    https://developer.wordpress.org/reference/functions/wp_enqueue_script/
    https://developer.wordpress.org/reference/functions/wp_dequeue_script/

    Kind Regards

Viewing 3 posts - 1 through 3 (of 3 total)