With it removed AJAX works, but with the snippet it doesn’t. The problem is, I like the solution that people can add the variable product to the cart on the shop page, so I want to keep that (even if it means AJAX doesnt function).
The altered snippet you’ve sent me didn’t do the trick. So I’m stuck for now…