Add this code before the </body> tag in your markup.
<script>
document.addEventListener('DOMContentLoaded', function () {
const addToCartButtons = document.querySelectorAll('.add-to-cart');
addToCartButtons.forEach(function (button) {
button.addEventListener('click', function () {
const productContainer = this.closest('.product');
const productImage = productContainer.querySelector('img');
/* Implement FlyTo */
flyTo(productImage, document.querySelector('.cart-dropdown'));
});
});
});
</script>