From a940eef70bfb8e6d4e3dfdae6c6ae91dbe04e1de Mon Sep 17 00:00:00 2001 From: gine Date: Sun, 29 Jan 2017 17:10:43 +0100 Subject: [PATCH] Fix notice when has not a property ID --- assets/js/ipq_input_value_validation.js | 2 +- includes/wcqu-functions.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/ipq_input_value_validation.js b/assets/js/ipq_input_value_validation.js index 31bcd19..b38e4bf 100755 --- a/assets/js/ipq_input_value_validation.js +++ b/assets/js/ipq_input_value_validation.js @@ -16,7 +16,7 @@ jQuery(document).ready( function($) { * If user enters a value that is out of bounds, * it will be auto corrected to a valid value. */ - $(document).on('change', '.qty', function(e) { + $(document).on('change input', '.qty', function(e) { var $input = $(e.currentTarget); // Get values from input box var step = $input.attr( 'step' ); diff --git a/includes/wcqu-functions.php b/includes/wcqu-functions.php index 5222691..1d844ca 100755 --- a/includes/wcqu-functions.php +++ b/includes/wcqu-functions.php @@ -343,7 +343,9 @@ function wcqu_get_value_from_rule( $type, $product, $rule ) { // Return Values from the Rule based on $type requested } else { - + if($rule == null || ! property_exists($rule, 'ID')) + return null; + switch ( $type ) { case 'all': //TODO: why get all and filter array?