Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Total discount View modes: 
User avatar
Member
Member
merete-grape - 9/16/2013 6:20:16 AM
   
Total discount
Need to show total discount in cart.

I would like to show customers what the total amount of discount is, not only per unit.

Total discount this order: kr. xxxx,-

User avatar
Member
Member
kentico_sandroj - 9/16/2013 1:17:05 PM
   
RE:Total discount
Hello,

Thank you for your message.

I am afraid that there currently isn't any built-in ways to display the total discount; the best approach would likely be to create a custom macro that evaluates all the different coupon types used on your site and combines them.

API Reference and Related F.A.Q

Would that approach work for you? Please let me know if you have any questions.

Best Regards,
Sandro

User avatar
Member
Member
merete-grape - 9/17/2013 4:04:51 AM
   
RE:Total discount
Need some help with this.

{% 
do until ECommerceContext.CurrentShoppingCart.ShoppingCartItems[n].TotalDiscount = ""
resultat = resultat + ECommerceContext.CurrentShoppingCart.ShoppingCartItems[n].TotalDiscount
n=n+1
loop
%}

Can't seem to get this working??
What am I missing??

Regards Merete

User avatar
Member
Member
kentico_sandroj - 9/17/2013 3:57:59 PM
   
RE:Total discount
Hello,

Thanks for posting the code sample. One issue is that you are missing semicolons to split statements but I would not use this approach because it could be bad for performance. Instead, it is recommended to create a custom macro and use ECommerceContext.CurrentShoppingCart.OrderDiscountInMainCurrency to get the values. Would this approach work for you? This would be better for performance.

Best Regards,
Sandro