I have a script that I am loading globally to perform a simple action on a specific page. It is showing up an error in the console.log because the other pages dont have the html needed to interact with my script.
To fix this i would like to load the script ONLY on the page type needed. Which is the woocommerce product category pages.
Here is the code I am using in my functions.php file
Any help is much appreciated, thanks!