Repository Forums Support WooCommerce Extended Coupon Features PRO FREE products at PRO version: not updating Reply To: FREE products at PRO version: not updating

#1494
Soft79
Keymaster

Hi Juliane,

I just sent you v2.5.3-b1. This fixes the JS error, and also the fact that free product selection was ALWAYS visible on checkout page.

About the jQuery:

– create a new JS file in your child theme (preferably in an assets/js/ directory). Let’s name it my-custom.js
– This contents:


jQuery( document ).on(
  'change input',
  '.wjecf-select-free-products :input',
  function() { 
    jQuery('form.woocommerce-cart-form input[name="update_cart"]').click();
} );

– Enqueue the script with this snippet in functions.php:


function enqueue_my_custom_script() {
  wp_enqueue_script( 'my-custom-js', get_template_directory_uri() . '/assets/js/my-custom.js', array( 'wjecf-free-products' ) );
};
add_action( 'wp_enqueue_scripts', 'my_custom_script' );