Jump to content

Custom code not working on mobile.

Recommended Posts

Hi, 

I've added some Code Injection to the Footer so that an accordion appears under my product description. It works perfectly on my live website but disappears on mobile - any idea why please? 

Code used:
 
<script>
(function(){
  var accordion = document.querySelector('.ProductItem-additional .accordion-block');
  var quantitylabel = document.querySelector('.quantity-label');                    
  
  if(accordion && quantitylabel) {
    // Remove accordion from current position.
    accordion.parentNode.removeChild(accordion);
    
    // Add accordion before the quantity label.
    quantitylabel.before(accordion);
  }
})()
</script>

URL:https://www.potsandpaperbysteph.com/shop/p/o3rmu4pac0fwpetkskvge721p57asg
Password: HELP

Thanks in advance! 🙂 

 

Screenshot 2023-09-05 at 16.16.11.png

Screenshot 2023-09-06 at 22.54.27.png

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.