WooCommerce: trigger event after change of variation

In case anyone stumbles across this in the future: WooCommerce provides triggers throughout the add-to-cart-variation.js which allows you to hook into change events for the website. You can find all of them available in that file, but one which will likely help most in this case can be used as such $( “.variations_form” ).on( “woocommerce_variation_select_change”, … Read more

How to check payment method on a WooCommerce order by id?

The post meta key for the payment method ID is simply _payment_method So if $order->payment_method doesn’t have the magic methods in place to get that automatically, you could retrieve the post meta using traditional WordPress get_post_meta( $order->id, ‘_payment_method’, true ); Update for WooCommerce 3.0 $order->get_payment_method();

Override WooCommerce Frontend Javascript

I had the same problem except with add-to-cart.js. Simple solution is to DEQUEUE the woocommerce script and ENQUEUE your replacement. In my case I added the following to my functions.php: wp_dequeue_script(‘wc-add-to-cart’); wp_enqueue_script( ‘wc-add-to-cart’, get_bloginfo( ‘stylesheet_directory’ ). ‘/js/add-to-cart-multi.js’ , array( ‘jquery’ ), false, true ); You would want to DEQUEUE the ‘wc-add-to-cart-variation’ script. I don’t think … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)