Support » Plugin: JS & CSS Script Optimizer » Woocommerce javascript combination problem

  • Hi, i just found a problem with Woocommerce. When this plugin is set to combine javascript then localized strings are not present. After hours of searching for solution, i have found it. In js-css-script-optimiser.php on line 98 is

    add_action('wp_print_scripts',array(__CLASS__, 'wp_print_scripts_action'), 0);
    array(__CLASS__, 'wp_print_scripts_action'), 0);

    But in woocommerce is hooked like this

    add_action( 'wp_print_scripts', array( __CLASS__, 'localize_printed_scripts' ), 5 );

    So this localized strings are printed after all scripts are combined, resp. they are not visible at all.

    Could you just change priority of that to 200? Thank you.

    add_action('wp_print_scripts',array(__CLASS__, 'wp_print_scripts_action'), 200);
    array(__CLASS__, 'wp_print_scripts_action'), 200);

Viewing 1 replies (of 1 total)
  • thx, payter!
    I changed in js-css-script-optimizer.php in lines 103-104 since ” 0);” to ” 200);” and now all works fine.

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce javascript combination problem’ is closed to new replies.