0

I am building a custom theme from scratch for WooCommerce (using the hooks/dev method). I just finished the Shop page and I found out that the select tag filter for the products (filter by price/date/name) is not working. I quickly switched to Twenty Eleven and figured out that I am missing some frontend JS from Woocommerce.

Now I could copy all those Js files that I need but in the assets/js/frontend are a lot of more .js files and I think that I may need them as I am far away from being done with the theme. Copying either the necessary or all the js from the WC plugin folder to my theme JS folder would not be a problem but I feel that this is not the best practice to deal with this issue.

I read somewhere that in order to override the frontend JS from WC you have to dequeue and then enqueue your JS file. Which will work for me, still similar to the copy method, as will have nothing to override (as I am not loading any WC JS) but I will end up with the scrips loaded (as I will queue them).

Am I missing something? There's nothing to cover around this subject. If there's no other way I would simply copy them.

Thank you

5
  • 1
    Do you have wp_head() and wp_footer() in your theme's header.php and footer.php respectively? If so, WooCommerce should load it's scripts without any intervention on your part. Commented Jul 22, 2016 at 23:12
  • I do not think I have wp_head() inside the header. I will add it and return with feedback. Thank you Commented Jul 22, 2016 at 23:51
  • See Theme Development Commented Jul 23, 2016 at 0:36
  • Indeed it was the wp_head() missing from the header. Thanks a lot! How do I mark your comment as the correct answer? Commented Jul 25, 2016 at 10:31
  • I've made it an "answer" so you can accept it. Commented Jul 25, 2016 at 16:24

1 Answer 1

4

Please be sure that you have wp_head() and wp_footer() in your theme's header.php and footer.php respectively. See Theme Development for best practices and standards.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.