diff --git a/commerce_coupon.module b/commerce_coupon.module index c719f71..84d0c53 100644 --- a/commerce_coupon.module +++ b/commerce_coupon.module @@ -490,11 +490,12 @@ function commerce_coupon_type_configure($bundle, $reset) { 'entity_type' => $entity_type, 'bundle' => $bundle, 'label' => 'Maximum number of Uses', - 'description' => 'Number of times that coupon code can be used by any customer on the site, before it is set to inactive', + 'description' => 'Number of times that coupon code can be used by any customer on the site, before + it is set to inactive. Set to -1 for unlimited.', 'required' => FALSE, 'display' => array(), 'settings' => array( - 'min' => '0', + 'min' => '-1', ), 'default_value' => array( 0 => array( diff --git a/commerce_coupon.rules_defaults.inc b/commerce_coupon.rules_defaults.inc index ca7cd12..71f7f99 100644 --- a/commerce_coupon.rules_defaults.inc +++ b/commerce_coupon.rules_defaults.inc @@ -45,6 +45,7 @@ function commerce_coupon_default_rules_configuration() { $rule ->event('commerce_coupon_validate') ->condition('entity_has_field', array('entity:select' => 'coupon', 'field' => 'commerce_coupon_number_of_uses')) + ->condition(rules_condition('data_is', array('data:select' => 'coupon:commerce-coupon-number-of-uses', 'value' => '-1'))->negate()) ->action('commerce_coupon_action_get_coupon_uses', array('commerce_coupon:select' => 'coupon')) ->action('component_commerce_coupon_validate_uses_of_coupon_component', array( 'commerce_coupon:select' => 'coupon',