(Squarespace) How to change add to cart to custom url for a specific item on store page

To change add to cart to custom url on a specific item on Store/Shop Page. You can follow these.

#1. First, find Product Item URL

In my example, it is: /store/p/country-feast-set-3nybt-zczh5-7w375

#2. Next, use this code to Code Injection > Footer

<script>
document.addEventListener('DOMContentLoaded', function() {
    var buttonHtml = '<a class="btn btn--border theme-btn--primary-inverse sqs-button-element--primary" href="https://google.com">Register</a>';
    
    var targetElement = document.querySelector('a.product-list-item-link[href="/store/p/country-feast-set-3nybt-zczh5-7w375"] + .product-list-item-add-to-cart');
    
    if (targetElement) {
        var newButton = document.createElement('div');
        newButton.innerHTML = buttonHtml;
        targetElement.parentNode.insertBefore(newButton.firstChild, targetElement.nextSibling);
    }
});
</script>
<style>
.product-list-item a.btn {
    margin-top: 20px;
    width: 100%;
    padding: 10px 0px !important;
    text-align: center;
}
a.product-list-item-link[href="/store/p/country-feast-set-3nybt-zczh5-7w375"] + .product-list-item-add-to-cart {
    display: none !important;
}
</style>

#3. Remember to update Product Item URL + New URL