If I edit archive-products.php adding a <button>, I can achieve some success, but it doesn’t work properly, and I realized that it might not be the solution. Because I saw all the added <button> at once one after another. I should rather use the hook method.
I wrote some code I paste here, I would like you to please help with some questions about it:
1. Does it seem correct?
2. Where do I have to put it (which file) because editing functions.php makes an instant crash of the site.