VoucherCode differentiation for Basket and OrderLine
Hey everybody,
i need some help with voucher codes. I need to add support for % vouchers and gladly ucommerce can do it.
The problem is, that i must differentiate if the voucher entered is for an OrderLine or the whole PurchaseOrder. I know that i can lookup in PurchaseOrder.Discounts and in OrderLine.Discounts if i got some vouchers. But sadly the voucher for a single product is also found in the PuchaseOrder.Discounts (of course thats right because it belongs to the PurchaseOrder).
Is there a way to check in the PurchaseOrder.Discounts if its for an OrderLine and for what specific OrderLine? Or is there any other way how i can achieve that?
thanks for the help. I got it working on friday with a method similar to yours.
The only difference is that i loop through all discounts and check some more custom stuff because i have to manage normal and percentage discounts in a different way.
VoucherCode differentiation for Basket and OrderLine
Hey everybody,
i need some help with voucher codes. I need to add support for % vouchers and gladly ucommerce can do it.
The problem is, that i must differentiate if the voucher entered is for an OrderLine or the whole PurchaseOrder. I know that i can lookup in PurchaseOrder.Discounts and in OrderLine.Discounts if i got some vouchers. But sadly the voucher for a single product is also found in the PuchaseOrder.Discounts (of course thats right because it belongs to the PurchaseOrder).
Is there a way to check in the PurchaseOrder.Discounts if its for an OrderLine and for what specific OrderLine? Or is there any other way how i can achieve that?
Thanks in advance.
David
You can find all discounts that belong to order lines with the following piece of code:
Hope this helps.
Hi Soren,
thanks for the help. I got it working on friday with a method similar to yours.
The only difference is that i loop through all discounts and check some more custom stuff because i have to manage normal and percentage discounts in a different way.
Excellent. Thanks for posting your findings on the forum. Appreciate that!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.