WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] varaitions js not loading (2 posts)

  1. cjc1867
    Member
    Posted 1 year ago #

    Hi
    I can't get the add-to-cart-variation.js to load, I can load it manually into the header but it should load via the plugin.

    I have checked other threads and came up with this but slightly modified:

    function mv_my_theme_scripts() {
    wp_enqueue_script('add-to-cart-variation', plugins_url('/woocommerce/assets/js/frontend/add-to-cart-variation.js'),array('jquery'),'1.0',true);
    }
    
    add_action('wp_enqueue_scripts','mv_my_theme_scripts');

    Why doesn't this load as it should? At the moment I have no 'add to cart' button and this file needs to be loaded.

    Looking at the html page the button is there but switched off via the style sheet.

    Colin

  2. cjc1867
    Member
    Posted 1 year ago #

    I took over a WordPress website with a custom theme with all kinds missing and have been steadily fixing bits and pieces.

    I replaced the original header with TwentyEleven's and got more things working, I then spent hours reading about other peoples similar problems and found that wp-footer() was missing from the footer file. Oh wp-header() was missing as well, quite surprised the website worked at all.

    It is now working as expected, what a nightmare.

    Colin

Topic Closed

This topic has been closed to new replies.

About this Topic