Remove and replace woocommerce add to cart button [closed]

I asked the question on stackoverflow and got the answered there. But what was the issues was that I used add_filter, had the wrong priority and used the wrong hook. The answer: https://stackoverflow.com/questions/68661105/remove-and-replace-woocommerce-add-to-cart-button