Buy me a coffee

Click button in Announcement Bar >> Open Checkout Page

Suppose you have a button: Checkout on Announcement Bar, and a product on your site. You want: When users click on this Checkout button >> It will add the product to the cart and open the checkout page.

#1. First, you need to follow this code to add a button to the Announcement Bar

#2. Next, enable Express Checkout

#3. Add a Product Block (you can add it to Site Footer)

#4. Use this code to Code Injection – Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).on('click', '#announcement-bar-text-inner-id p a', function(event) { 
    event.preventDefault(); 
    $('div.sqs-add-to-cart-button').click(); 
});
</script>

click-button-in-announcement-bar-open-checkout-page-01-min

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder