hmmm. Looks like there is a conflict between CleanMart <-> AWOCOUPON
Because in default Virtuemart, there is no CROSS ICON to remove the entered coupon code. Apparently AWOCOUPON adds it there. Adding a CROSS icon next to coupon code makes the coupon element HTML. But it should have been a string (ordinary text), because in CleanMart, we are using the coupon element in the INPUT FIELD as the default value. (HTMLs can't be used as default value for input fields)
Try this patch (for those who are using AWOCOUPON, should apply this patch)
1- Open this PHP file:
/templates/YOUR_TEMPLATES/html/com_virtuemart/cart/default_pricelist.php
2- Look for these lines (starts at line # 258):
<input type="text" name="coupon_code" size="20" maxlength="50" class="flexibleCouponInput" autocomplete="off" placeholder="<?php echo (empty($this->cart->cartData['couponCode'])) ? JTEXT::_('TPL_FLEXIBLE_APPLY_ENTER_COUPON_CODE') : $this->cart->cartData['couponCode'];?>" value="<?php echo (empty($this->cart->cartData['couponCode'])) ? "" : $this->cart->cartData['couponCode'];?>"><br/>
<input class="flexibleButton" type="submit" name="setcoupon" title="Save" value="<?php echo (empty($this->cart->cartData['couponCode'])) ? JTEXT::_('TPL_FLEXIBLE_APPLY_DISCOUNT_CODE') : JTEXT::_('TPL_FLEXIBLE_APPLY_ANOTHER_DISCOUNT_CODE');?>" >
3- Replace everything with these:
<?php
if (!empty($this->cart->cartData['couponCode'])) {
echo $this->cart->cartData['couponCode'];
} else {
?>
<input type="text" name="coupon_code" size="20" maxlength="50" class="flexibleCouponInput" autocomplete="off" placeholder="<?php echo (empty($this->cart->cartData['couponCode'])) ? JTEXT::_('TPL_FLEXIBLE_APPLY_ENTER_COUPON_CODE') : $this->cart->cartData['couponCode'];?>" value=""><br/>
<input class="flexibleButton" type="submit" name="setcoupon" title="Save" value="<?php echo JTEXT::_('TPL_FLEXIBLE_APPLY_DISCOUNT_CODE');?>" >
<?php } ?>
Then you should be good to go.
This code change basically does:
-
If no coupon entered: Show the form
-
If a coupon entered: Hide the form and show the coupon with the RED CROSS ICON next to it.
FYI # 1: As you might know, it is only possible to enter 1 coupon code at a time, so it makes sense to hide the coupon-form when a code has already been entered.
FYI # 2: I assume that, the RED CROSS icons, which is injected by AWOCOUPON component, works just find to remove the coupon.
FYI # 3: If you don't want to hide the coupon-form even though the code has been entered, then replace the lines (from bullet#2) with these instead:
<?php if (!empty($this->cart->cartData['couponCode'])) echo '<p>'.$this->cart->cartData['couponCode'].'</p>'; ?>
<input type="text" name="coupon_code" size="20" maxlength="50" class="flexibleCouponInput" autocomplete="off" placeholder="<?php echo JTEXT::_('TPL_FLEXIBLE_APPLY_ENTER_COUPON_CODE');?>" value=""><br/>
<input class="flexibleButton" type="submit" name="setcoupon" title="Save" value="<?php echo (empty($this->cart->cartData['couponCode'])) ? JTEXT::_('TPL_FLEXIBLE_APPLY_DISCOUNT_CODE') : JTEXT::_('TPL_FLEXIBLE_APPLY_ANOTHER_DISCOUNT_CODE');?>" >
This code displays the entered code at the top,as well as the coupon-form underneath. It might be useful for those are are willing to enable entering multiple coupon codes at a time
Regards.