Why can't I close the 'See stock in another store' window in Impact Theme?

Topic summary

A user encountered an issue with the Impact Theme where the close button (X) on the ‘See stock in another store’ popup window was non-functional.

Solution Provided:

  • Navigate to Admin → Themes → Edit code
  • Locate the theme.liquid file
  • Insert custom JavaScript code before the closing </body> tag
  • The code targets the drawer’s shadow DOM and programmatically adds a click event listener to the close button
  • Uses setTimeout to ensure elements load before attempting to attach the event

Outcome:
The solution successfully resolved the issue, allowing the popup to close properly when clicking the X button.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hello.

When i click on “See stock in another store” i cant click on the X to close the windows? Can anyone help me .. using Impact Theme

Link to website HERE

Hi @Dclootbox ,

Step 1: Go to Admin page → Select Themes → Select Edit code

![view - 2023-11-30T185900.948.png|2000x976](upload://qUjA9G1g0AKCfai5eauVuWw9S3Q.png)

Step 2: Find the theme.liquid file and add the code below near the end of the file, right before the closing tag

<script>
setTimeout(()=> {
  if(window.location.href.includes("/products/")) {
         console.log("aa")
        const btnClose = document.querySelector("x-drawer").shadowRoot.querySelector("div:nth-child(4) > header > button > svg")
        const modalELement = document.querySelector("x-drawer")
        btnClose.addEventListener('click', () => {
            modalELement.removeAttribute("open");
        })
   }
}, 800)
</script>

Result:
https://www.loom.com/share/9b2937502a3b46fe9f7962c3e8debf82?sid=88498e1c-24e1-46e5-a605-5fa7f91f4f7a

Hope it helps @Dclootbox

It works ! Thanks so much :slightly_smiling_face: