Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Responsive Joomla Virtuemart Template - SportMart (SKU# FLEX-00019)

TOPIC: coupon code weird code + field in white?

coupon code weird code + field in white? 8 years 4 months ago #13457

Hello I have just update the cleanmart theme wich is FANTASTIC! keep going on such a great job!

I have some issue with coupon code from (from VM and AWOCOUPON) please see picture when you enter a correct coupon code

As well when i type text in field it is in white therefore you do not see what you are typing

thank you
Attachments:
The topic has been locked.

coupon code weird code + field in white? 8 years 4 months ago #13465

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.
Last Edit: 8 years 4 months ago by Support.
The topic has been locked.

coupon code weird code + field in white? 8 years 4 months ago #13471

Thank you it work perfectly!!!

But i still have the issue with white field, do you know how to make the text area not white?
exemple in picture bug1 when you type a coupon code or want to enter adress in adress field it then writte in white so you dont see what you are writting
thank you
Last Edit: 8 years 4 months ago by M grano.
The topic has been locked.

coupon code weird code + field in white? 8 years 4 months ago #13488

hi,

Can you provide me the shopping cart URL of your website?

This is something i can provide a solution only if i see your website in action. Because this is CSS related, and i don't know what CSS rules AWOCOUPON is applying to the coupon field.

regards.
The topic has been locked.

coupon code weird code + field in white? 8 years 2 months ago #13681

Alll fixed thank you very much!
The topic has been locked.

coupon code weird code + field in white? 8 years 2 months ago #13714

Hi, good to know.

CAse solved, topic is closed.

regards
The topic has been locked.
Time to create page: 0.158 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo