How to add an anchor automatically when I click on woo commerce add to cart

I'm trying to add the "orderr" anchor to the link when the add to cart button is pressed. Basically, I'm interested that when someone adds a product to the cart, the page automatically scrolls to the "orderr" id section, on the same page, where they have to fill in their data. I managed to make a function with the help of Chatgpt which apparently works perfectly, except in the facebook browser. When someone clicks on the Facebook ad, the site loads in their browser (Facebook), and apparently this function no longer works. Does anyone have an idea how I can solve this situation? Thank you in advance

Comment (0)

You’ll be in good company