Settings API form – submit with AJAX

I just tested your code, I guess the ajaxurl in your javascript is wrong, it must be: <?php echo admin_url( ‘options.php’ ); ?> This is the code I have tested. class TestAjaxSettingsAPI { public function __construct() { add_action( ‘admin_menu’, array( $this, ‘agy_admin_menu’ ) ); add_action( ‘admin_init’, array( $this, ‘agy_register_settings’) ); } public function agy_admin_menu() { … Read more

Stop a script on a single page

In the body classes you shoud also find a class corresponding to the page id (i.e. <body class=”.. page-id-161″>) In this case you can modify your script: (function($) { //create array of classes for pages where to exclude the .wppr-review-container from being moved var toExclude=[‘page-id-161′,’page-id-162′,’page-id-163’]; // get all the <body> classes var elementClasses = jQuery(“body”).attr(“class”).split(” … Read more

List of JS events in the WooCommerce frontend

On a hunt for the same I took a little dive into the JS source files. Woocommerce Javascript events Woocommerce Checkout JS events $( document.body ).trigger( ‘init_checkout’ ); $( document.body ).trigger( ‘payment_method_selected’ ); $( document.body ).trigger( ‘update_checkout’ ); $( document.body ).trigger( ‘updated_checkout’ ); $( document.body ).trigger( ‘checkout_error’ ); $( document.body ).trigger( ‘applied_coupon_in_checkout’ ); $( document.body … Read more