Developer forum

Forum » Ecommerce - Standard features » OrderVoucherUseType

OrderVoucherUseType

Dynamicweb Employee
Jeremy Fesmire
Reply

Hello,

I am working with orders using a discount voucher. On the orders there is some discrepencies on the discount being applied. When looking in the database at the EcomOrders table I noticed that the order records that had the discount applied properly had 'OrderVoucherUseType'=2 and the order records that did not apply the discount have a 'OrderVoucherUseType'=0. All of the orders are using the same OrderVoucherCode.

My questions is what is the 'OrderVoucherUseType' fields purpose and how is it populated?

Thanks,

Jeremy


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Jeremy,

The value of OrderVoucherUseType indicates where the voucher code (OrderVoucherCode) has been used.

None = 0
SalesDiscount = 1
Discount = 2
Loyalty = 4

If the value is 2 then a voucher discount was applied.
If the value is 0 then the voucher was not used.

So your discount is probably configured so that it doesn't apply to all orders - or the voucher code was not valid/available at that time.
Check if the discount is configured to only apply for selected users, products, order total price minimum, etc. and compare that to the orders you have.

If you are not sure why the discount is not applied then you can render discount validation results.
You need to activate validation on the discount and use a template which renders the validation results.
See https://doc.dynamicweb.com/documentation-9/ecommerce/payment-shipping/discounts-offers

Best regards,
Morten

 

You must be logged in to post in the forum