Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Vladimir Trandev

    (@vtrandev)

    Hello @suba89,

    You can exclude your external script from being combined using the below filter:

    add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
    function js_combine_exclude_external_script( $exclude_list ) {
        $exclude_list[] = 'cbcmpgs.gateway.mastercard.com';
    
        return $exclude_list;
    }

    However, if the error is still logged, please feel free to submit a support ticket in your Client Area at Siteground.

    Regards,

    Vladimir

    Thread Starter suba89

    (@suba89)

    Thank you @vtrandev.

    I am new to woo-commerce plugin. This is my current code.

    public function __construct()
     {
       // some other code.
    
     add_action('wp_footer', array($this, 'enqueueAssets'));
    }
    
    public function enqueueAssets()
    {           
      wp_register_script('checkoutwaiting', plugins_url('../js/checkout.js', __FILE__), array('jquery'), '', true);
      wp_enqueue_script('checkoutwaiting');
    }

    How can i edit? Is this the way to edit?

    public function __construct()
     {
       // some other code.
    
     add_action('wp_footer', array($this, 'enqueueAssets'));
    }
    
    public function enqueueAssets()
    {           
      wp_register_script('checkoutwaiting', plugins_url('../js/checkout.js', __FILE__), array('jquery'), '', true);
      wp_enqueue_script('checkoutwaiting');
    add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
    }
    
    function js_combine_exclude_external_script( $exclude_list ) {
        $exclude_list[] = 'cbcmpgs.gateway.mastercard.com';
    
        return $exclude_list;
    }
    

    Also, I wanted to confirm that, This issue is happening due to my plugin issue or hosting server issue? I have tried with my internal server, The plugin is working. It is not working in the outside hosting server.

    Thank you for your time

    Plugin Support Vladimir Trandev

    (@vtrandev)

    Basically, there is no need of caching mechanism for a local installation of your website.

    The code that I provided in my previous post should be added in the functions.php file of the theme that you are using for your application.

    Regards,

    Vladimir

    Thread Starter suba89

    (@suba89)

    Thank you @vtrandev. I have added the code to the function.php file and checked. I can see the below error in my browser console.

    Uncaught No script found with scriptLocation ‘https://cbcmpgs.gateway.mastercard.com/checkout/version/57/checkout.js’

    Is it a issue with my woo-commerce plugin?

    • This reply was modified 1 year, 10 months ago by suba89.
    Plugin Support kuzmanstoyanov

    (@kuzmanstoyanov)

    Hello @suba89,?

    We would not be able to investigate properly without having access to the website and without being able to recreate the error from our side. 

    I would advise you to disable the following Frontend Optimization features one-by-one and verify which one is causing the error:

    Combine JS files
    Defer Render-blocking JavaScript?

    Based on that, there are different filters you can use to exclude the script from being combined/deferred. You can preview all of the exclude filters here.?

    You may also refer to this thread, which explains how to properly use the filters.?

    If you are a SiteGround client, please, submit a support inquiry from your SiteGround Client Area. The technical support team will be able to assist if the error is caused by SiteGround Optimizer or the hosting environment.

    Best Regards,
    Kuzman Stoyanov

    Thread Starter suba89

    (@suba89)

    Thank you @kuzmanstoyanov. I will check with it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Uncaught No script found with scriptLocation in woo-cormmerce plugin’ is closed to new replies.