Jump to content

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

Recommended Posts

Posted (edited)

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
Link to comment
  • lovex3you changed the title to Product information section showing below 'Add to cart' button on Mobile
  • Replies 2
  • Views 983
  • Created
  • Last Reply

Top Posters In This Topic

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. 
I remember when it was all wild prairies round these here parts. 🐃🤠
Advice I give on here is free, though I may sometimes post an affiliate link or promote something I've written.
That reminds me.. ..you might want to check out my
Squarespace template finder or have a look at my other Squarespace tips
Speaking of tips, 💲I've got a tip jar that you're welcome 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  

 

Link to comment

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.