discount codes - turn off autocomplete?

Permalink
Hi guys,

I need to stop the discount field in the checkout on core commerce from auto completing discount codes.

I'm guessing this will be a quick fix, but i've found the file i need to modify to add the attribute 'autocomplete="off"' but not sure where to add it?

The content of the core_commerce/elements/checkout/discount.php file

<form method="post" action="<?php echo $action?>">
   <?php echo t('To claim a discount, enter a valid coupon code below. If you don\'t have a discount code, just click "Next" to skip this step.')?>
   <?php echo $form->text('discount_code', $discount_code, array('style' => 'width: 150px'))?>  
   <?php echo $this->controller->getCheckoutNextStepButton()?>
   <div class="ccm-core-commerce-cart-buttons">
   <?php echo $this->controller->getCheckoutPreviousStepButton()?>
   </div>
   <div class="ccm-spacer"></div>
</form>


Does anyone know where i'd put the 'autocomplete="off"'?

thanks for looking

 
mesuva replied on at Permalink Best Answer Reply
mesuva
The third parameter of the text function, the array, is used to pass in attributes to add to the input tag. So you would change this to be:
<?php echo $form->text('discount_code', $discount_code, array('style' => 'width: 150px', 'autocomplete' => 'off'))?>