Hi Riaan! Thank you for your help.
I want to explain my problem again:
* I have a ‘woocommerce_cart’ shortcode that doesn’t loads the scripts that it needs to work via ajax (like when updating cart and etc…) on other pages than the cart page
* I see that in the class-wc-frontend-scripts.php the enqueue of that script goes only when is_cart() statement.
* I am figuring out that I need to add if(shortcode_exists(‘woccommerce_cart’)) so it would enqueue also when it is a shortcode.
* I am adding that IF and I see that everything works on front end.
* I am thinking that it is not a good idea to put that in the original plugin file because it would be overwritten with the next update.
* I am trying to enqueue the script in my functions.php file with the new IF.
* Nothing works….
* Going back to the original file
* On line 247 (here: https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-frontend-scripts.php) there is a function that adds more functionality to the ajax that without it it wont work…
* Now I am wondering is there a way to add another IF to the same file using a hook? Or should I override all the file? (as I said before I think it is not a good practice because all the functions there wont get any updates).
* So basically I know what I need to do, I just don’t know what is the best way to do it and if it possible doing it with a hook or other function that maybe somebody knows and I’m not familiar with….
Thank you again for your help! ??