Jump to content

Instruction on how to fix the "pressing-enter-doesn't-add-the-voucher"


Recommended Posts

With the current prestashop_1.1.zip, when the user presses "Enter" to add the voucher on the Shopping cart summary page, the voucher is not entered unless the "Add" button is clicked.

I found the solution to this problem:

Open up \themes\prestashop\shopping-cart.tpl and find these lines:

    <form action="{$smarty.server.PHP_SELF|htmlentities}" method="post" id="voucher">

{l s='Vouchers'}


{l s='Code:'}
               <input type="text" id="discount_name" name="discount_name" value="{if $discount_name}{$discount_name}{/if}" />


<input type="submit" name="submitDiscount" value="{l s='Add'}" class="button" /></p>

   </form>



Add this line

<input type="hidden" name="submitDiscount" value="{l s='Add'}" />

in between the

and

so it looks like:

    <form action="{$smarty.server.PHP_SELF|htmlentities}" method="post" id="voucher">

{l s='Vouchers'}


{l s='Code:'}
               <input type="text" id="discount_name" name="discount_name" value="{if $discount_name}{$discount_name}{/if}" />
               <input type="hidden" name="submitDiscount" value="{l s='Add'}" />


<input type="submit" name="submitDiscount" value="{l s='Add'}" class="button" /></p>

   </form>



Save and upload to replace the file. Now you can press "Enter" to submit the Voucher.

Hope this helps a bit.

Link to comment
Share on other sites

×
×
  • Create New...