Developer forum

Forum » Ecommerce - Standard features » Validation of EcomOrderVoucherCode

Validation of EcomOrderVoucherCode

Grant Menzies
Reply

I have a shop where the field EcomOrderVoucherCode is used.

I can't seem to get validation errors to work for this field.

The following has been set up:

  1. A validation group has been created for Voucher code with rule "Is Valid"
  2. In the settings for the checkout module I have added the field for validation. The error message is set to "error"
  3. In my front-end I have the voucher code working (attached to a discount type)
  4. In the template I use the following code: <input class="<!--@Ecom:Cart.ValidationError.EcomOrderVoucherCode.ErrorMessage-->" type="text" name="EcomOrderVoucherCode" id="EcomOrderVoucherCode" value="<!--@Ecom:Order.Customer.VoucherCode-->" />

On inspecting the TemplateTags output i can see that the value for <!--@Ecom:Cart.ValidationError.EcomOrderVoucherCode.ErrorMessage--> is nothing. Whereas other input fields render "error" (if there is an error).

What am I missing?

 


Replies

 
Merethe Nielsen
Reply

Hi,

 

The validation works if the voucher is exprired (rule: Is expired) but there is a bug in the validation if the voucher code is typed wrong (rule: Is valid).
The bug number is 14888.

 

Kind regards,
Merethe

 

 
Grant Menzies
Reply

Ok, thanks for your reply!

Is there a way I can use javascript to check if the voucher is valid?

 
Merethe Nielsen
Reply
This post has been marked as an answer

Hi,

Bug 14888 is fixed now and available with the hot fix that has been build an hour ago :)

The hot fix can be downloaded here: http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx
Read more about the hot fix here: http://developer.dynamicweb-cms.com/releases/dynamicweb-8-4-1/bug-fixes-8-4-1.aspx
 

Kind regards,
Merethe

 

Votes for this answer: 1

 

You must be logged in to post in the forum