Developer forum

Forum » Feature requests » Discounts in basket

Discounts in basket

Jim Trebbien
Reply

Is it possible to not have discounts show in the basket as a product?

Right now when a customer puts a product with a discount in the basket, the discount is shown like it is another product with a negative price.

Is there an alternative way to show discounts?


Replies

 
Morten Bengtson
Reply

You can use if statements in your template to check the orderline type and then create different markup for discounts...

<!--@LoopStart(OrderLines)-->

<!--@If(Ecom:Order:OrderLine.Type=3)-->
Product discount
<!--@Else-->
Regular orderline
<!--@EndIf-->

<!--@LoopEnd(OrderLines)-->

OrderLineType
0: Product
1: Discount
2: Fixed
3: ProductDiscount
4: Tax

 
Merethe Nielsen
Reply

Hi,

There is also a tag called Ecom:Order:OrderLine.IsProduct that can be used:

http://templates.dynamicweb.com/eCommerce/Dynamicweb-eCommerce-template-tags/Shopping-Cart-V2/Order/Cart/Loops/Orderlines/EcomOrderOrderLine-IsProduct.aspx

Kind regards,
Merethe

 
Morten Bengtson
Reply

Hi Merethe,

 

So we have the template tag IsProduct, which value is true when the order line is of type Product or Fixed.

It's kinda weird that we don't have similar tags for discounts and taxes, like IsDiscount and IsTax. Could these be added?

This would make templates a lot easier to understand :)

 

BAD:

<!--@LoopStart(OrderLines)-->
 
<!--@If(Ecom:Order:OrderLine.Type=0 || Ecom:Order:OrderLine.Type=2)-->
... Product ...
<!--@EndIf-->

<!--@If(Ecom:Order:OrderLine.Type=1 || Ecom:Order:OrderLine.Type=3)-->
... Discount ...
<!--@EndIf-->

<!--@If(Ecom:Order:OrderLine.Type=4)-->
... Tax ...
<!--@EndIf-->
 
<!--@LoopEnd(OrderLines)-->

 

GOOD:

<!--@LoopStart(OrderLines)-->
 
<!--@If Defined(Ecom:Order:OrderLine.IsProduct)-->
... Product ...
<!--@EndIf-->

<!--@If Defined(Ecom:Order:OrderLine.IsDiscount)-->
... Discount ...
<!--@EndIf-->

<!--@If Defined(Ecom:Order:OrderLine.IsTax)-->
... Tax ...
<!--@EndIf-->
 
<!--@LoopEnd(OrderLines)-->
 
Merethe Nielsen
Reply
This post has been marked as an answer

Hi Morten,

I have sent this request to our Product Management that will take a look at the request and prioritize it if added it to the backlog.

Have a nice day :)

Kind regards,
Merethe

Votes for this answer: 1