Repository Forums Support WooCommerce Extended Coupon Features PRO Why is wjecf-free-products.js needed on every page load?

Topic Resolution: Resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1705
    Jonathan Moore
    Participant

    Hi,
    Why is wjecf-free-products.js needed on every product page load?
    Shouldn’t this only be needed on the cart and checkout page?

    I’m just debugging a case of too many scripts and too many ajax calls and wondering if I can suppress this script safely..

    #1708
    Soft79
    Keymaster

    Yeah, I guess you can unload it for non-cart/checkout pages.

    #1730
    Jonathan Moore
    Participant

    done as:

    
    if ( (!is_cart()) && ( !is_checkout()) ){
        wp_dequeue_style('wjecf-style');
        wp_dequeue_script('wjecf-free-products');
    }
    

    though it would be more efficient to change the code to not enqueue them where not needed…

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.