Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning with latest wordpress #7

Open
badpenguin opened this issue Mar 31, 2014 · 1 comment
Open

warning with latest wordpress #7

badpenguin opened this issue Mar 31, 2014 · 1 comment

Comments

@badpenguin
Copy link

Notice: Undefined property: WC_PaymentGateway_Add_Charges::$plugin_url in wp-content/plugins/woocommerce-add-charges-to-payment-gateways-master/woocommerce-add-extra-charges-option-to-payment-gateways.php on line 148

Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in wp-includes/functions.php on line 3049

@eleazan
Copy link

eleazan commented Apr 1, 2014

Try to change:

wp_enqueue_script( 'wc-add-extra-charges', $this->plugin_url() . '/assets/app.js', array('wc-checkout'), false, true );

With that:

add_action('wp_enqueue_scripts', 'whateveryouwant_enqueue_scripts');

And add this:

function whateveryouwant_enqueue_scripts() {
   wp_enqueue_script( 'wc-add-extra-charges', WP_PLUGIN_URL. . '/assets/app.js', array('wc-checkout'), false, true );
}

Or something similar :-)

Try :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants