Jump to content

Additional info accordian to show on mobile

Recommended Posts

Site URL: http://ralop-srabwot.squarespace.com

Hi, I'm using code injection to move an accordian (in additional info) up to the buy button, the problem is it only shows on desktop not on mobile preview. Any ideas?

Code (sitewide code injection):

<!-- Move accordian up on product pages -->
<script>
(function(){
  var accordion = document.querySelector('.ProductItem-additional');
  var cartButton = document.querySelector('.sqs-add-to-cart-button-wrapper');                    
  
  if(accordion && cartButton) {
    // Remove accordion from current position.
    accordion.parentNode.removeChild(accordion);
    
    // Add accordion before the cart button.
    cartButton.before(accordion);
  }
})()
</script>

Muchas gracias 🙂

Link to comment
  • Replies 7
  • Views 276
  • Created
  • Last Reply

Top Posters In This Topic

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.