Hello,
In AwoCoupon 2, you can try something like this:
in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php around line 119 is this code:
<?php
$coupon_codes = implode('","',$coupon_awo_entered_coupon_ids);
?>
Right after that add this:
<?php
$number_of_coupon_codes = 1;
$sql = 'SELECT * FROM #__awocoupon WHERE function_type="coupon" AND coupon_code IN ("'.$coupon_codes.'") ORDER BY FIELD(coupon_code, "'.$coupon_codes.'")';
$db->setQuery( $sql );
$tests = $db->loadObjectList();
if(count($tests)>$number_of_coupon_codes) $removecoupons = array_slice($tests,0,$number_of_coupon_codes-count($tests));
if(!empty($removecoupons)) {
foreach($removecoupons as $r) if(($key = array_search($r->coupon_code, $coupon_awo_entered_coupon_ids)) !== false) unset($coupon_awo_entered_coupon_ids[$key]);
}
$coupon_codes = implode('","',$coupon_awo_entered_coupon_ids);
?>
Note, this is untested, but should get you in the correct direction.