Disable woocommerce PLACE ORDER button if user selected products that are not available for international delivery

Since I do not have a great answer for you after checking logic above (seems okay).. something else I noticed. add_action(‘woocommerce_update_order_review’ … Are you using the most recent update? I see no reference here docs.woothemes.com/wc-apidocs/hook-docs.html or on github depo for that do_action. Here is the current layout for hooks/filters on form-checkout.php.. Are you sure you … Read more

jQuery plugin not loading

It might be the case that you are using you JS validation before enqueuing this script. You code may be like.. <html> $(“#myForm”).validate(); or JS file that uses validate() jquery.validate.js here </html> Above code is just for demonstrating. So you are using validate() function before it has been enqueued so it is throwing validate() is … Read more

How do I sanitize the str_replace function in javascript variables

esc_js() is intended for escaping data for use within an HTML attribute. If you want to escape data for use within an inline script, wp_json_encode() should be sufficient. For example: var disabledDays = <?php echo wp_json_encode( $iva_disable_days ); ?>; This outputs: var disabledDays = [“4\/7\/2018″,”11\/18\/2017”]; If you check the variable in your dev tools console, … Read more

Using $wpdb | checking entered email against existing emails in db

You shouldn’t be using mysql_num_rows() or mysql_error() when dealing with $wpdb. Even if you weren’t, mysql_error() is for database errors, and an empty result set is not a database error. If you want to know if results were returned, simply check the count() of the results: $duplicateEmail = $wpdb->get_results($emailTest, OBJECT); if ( count( $duplicateEmail ) … Read more

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