*** uc_restrict_qty.module	2010-06-26 16:24:50.502517159 -0400
--- uc_restrict_qty.module.orig	2009-01-20 11:23:15.000000000 -0500
***************
*** 44,58 ****
      '#description' => t('The number of different products that can be added to a cart. Set to 0 for unlimited.'),
      '#default_value' => variable_get('uc_restrict_qty_global', '0'),
    );
-   
-   /* option to remove cart contents on new add  - UnGround*/
-   $form['uc_restrict_qty_global_replace'] = array(
-     '#title' => t('Replace Contents'),
-     '#type'  => 'checkbox',	
-     '#description' => t('Enabling this feature will cause the users cart to be emptied if they add more items than the Global Limit set above. This is best used when you offer mutually exclusive content (such as subscription services) where purchasing more then one product is not a valid option.'),
-     '#default_value' => variable_get('uc_restrict_qty_global_replace',false),
-    );
-    /* END UnGround addition */
  
    return $form;
  }
--- 44,49 ----
***************
*** 92,124 ****
   */
  function uc_restrict_qty_add_to_cart($nid, $qty, $data) {
    $limit = variable_get('uc_restrict_qty_global', 0);
-   /* for replace Cart enhancement - UnGround */
-   $replaceCart = variable_get('uc_restrict_qty_global_replace',false);
-   /* END UnGround addition */
  
    // If a global restriction on the number of items has been made.
    if ($limit > 0) {
      if (count(uc_cart_get_contents()) >= $limit) {
!     /* for replace Cart enhancement - UnGround */
!     	if($replaceCart) {
!     		db_query("DELETE FROM {uc_cart_products} WHERE cart_id = '%s'", uc_cart_get_id());
!     		
!     		$result[] = array(
! 		'success' => TRUE,
! 	      );
!     	}
! 	    else {
! 	    /* END replace Cart enhancement - UnGround */
! 	      $message = format_plural($limit, 'Sorry, you may only have 1 item in your cart. You must checkout or remove the item in your cart before adding a different item.',
! 		'Sorry, you may only have a total of @count items in your cart.  You must checkout or remove items from your cart before adding others.');
! 
! 	      $result[] = array(
! 		'success' => FALSE,
! 		'message' => $message,
! 	      );
! 	      /* for replace Cart enhancement - UnGround */
! 	    }
! 	    /* END replace Cart enhancement - UnGround */
      }
    }
    return $result;
--- 83,99 ----
   */
  function uc_restrict_qty_add_to_cart($nid, $qty, $data) {
    $limit = variable_get('uc_restrict_qty_global', 0);
  
    // If a global restriction on the number of items has been made.
    if ($limit > 0) {
      if (count(uc_cart_get_contents()) >= $limit) {
!       $message = format_plural($limit, 'Sorry, you may only have 1 item in your cart. You must checkout or remove the item in your cart before adding a different item.',
!         'Sorry, you may only have a total of @count items in your cart.  You must checkout or remove items from your cart before adding others.');
! 
!       $result[] = array(
!         'success' => FALSE,
!         'message' => $message,
!       );
      }
    }
    return $result;
