Jump to content

Product information section showing below 'Add to cart' button on Mobile

Featured Replies

Posted

I used a custom code block provided by this community to move "additional product details" directly below the product description. However, on mobile it's making my regular product detail show below the 'add to cart' button and everything else is showing above.

How can i fix this?
 

Screenshot 2024-05-20 at 10.34.57 AM.png

Screenshot 2024-05-20 at 10.33.57 AM.png

Screenshot 2024-05-20 at 10.34.08 AM.png

Edited by lovex3you
typo

  • lovex3you changed the title to Product information section showing below 'Add to cart' button on Mobile
  • Replies 2
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

Try this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() {
    function repositionElement() {
      if ($(window).width() > 768) {
        $('section.ProductItem-additional').insertAfter('.ProductItem-details-excerpt');
      }
    }

    repositionElement();
    $(window).resize(repositionElement);
  });
</script>
<style>
  @media (min-width: 769px) {
    section.ProductItem-summary {
      align-items: flex-start !important;
    }
    section.ProductItem-additional {
      margin-top: 20px !important;
      margin-bottom: 20px !important;
    }
  }
</style>

It checks the width of the viewport and only repositions the item if width > 768px.

 

I'm Colin Irwin aka silvabokis.  I've been a Squarespace designer & developer since 2013. 
Recent article: Find out Why your Squarespace images might be bigger than you think
You might want to check out my
Squarespace Template Finder or read my Squarespace tips
Speaking of tips, 💲I've got a tip jar. Feel free to throw a few quid into if you think I've helped you. 

If you're looking for a Squarespace developer Book a chat or Drop me a line - first meeting is always free  

 

Create an account or sign in to comment

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.

Welcome to the Circle Forum!

The Circle forum will be your homepage for all Circle updates.

Start by introducing yourself to the community!

Introduce yourself