Jump to content

Add a second button to product details page

Recommended Posts

I added a "Learn More" button above the add to cart on the product page, but now it's also appearing on the "add-on" product, which is not intended. Below is the code I used. Do you have any ideas on how to fix this?  

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
        $('section.ProductItem-additional .button-block').insertBefore('.ProductItem-details .sqs-add-to-cart-button-wrapper');
    });
</script>

Site: https://accordion-clarinet-az49.squarespace.com/shops/p/style-01-ej5na-4l2gy-r5why

Password: thecontent

Screenshot 2024-08-30 at 2.32.02 PM.png

Link to comment
  • Replies 1
  • Views 194
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

@kat24 Hi! You can update your script to the following:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
        $('section.ProductItem-additional .button-block').insertBefore('.ProductItem-details .ProductItem-quantity-add-to-cart .sqs-add-to-cart-button-wrapper');
    });
</script>

Or simply just add this CSS code under Website > Pages > Website Tools > Custom CSS

.add-on-card .button-block {
    display: none !important;
}

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.