Developer forum

Forum » Ecommerce - Standard features » Display giftcards and discount correct in frontend

Display giftcards and discount correct in frontend

Mikkel Belchuke
Mikkel Belchuke
Reply

Hi DW. 

We are having some issues displaying both Giftcard and Discounts in the cart, reciept and order confirmation emails. 

Do you guys have any logic to show both?


Replies

 
Nicolai Pedersen
Reply

Hi Mikkel

What issues are you facing? Technical or more of a logical character?

We might have something in Rapido...

BR Nicolai

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi Nicolai. 

We wanted to show both giftcard and a possible discount in the cart as well. 

But right now, the logic to display discount is to check for any kind of discount (which includes the use of a giftcard). 

What we are looking for, is a discount loop and a giftcard loop (right now, there is a loop for the giftcards, but this will tamper with the regular discount) 

 
Nicolai Pedersen
Reply

Hi Mikkel

I am a bit confused. Do you have some screendumps or code to show that can visualize the issue? Sorry for my latency :-)

BR Nicolai

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi Nikolaj. 

Sure. Lets say, that we have a scenario where the customer has chosen a product with a discount. Now the total, in the cart, will show a discount row if the logic looks like this:

@if (GetDouble("Ecom:Order.TotalDiscount.Price") < 0){

}

But what if at the same time, the customer wants to use a giftcard? How should we distinguish this?

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi Nicolai. 

Did you have time to look at this issue? 

 
Nicolai Pedersen
Reply

Nope, and I still do not understand the question...

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Which part don't you understand? :)

 
Nicolai Pedersen
Reply

What you want to achieve or what the problem is.

Is it because the conditional use that tag? You can see on an orderline if it has discounts or not using i.e.

if (orderline.GetDouble("Ecom:Order:OrderLine.UnitPrice.PriceWithVAT.Value") != orderline.GetDouble("Ecom:Product.Discount.Price.PriceWithVAT.Value"))

instead. Or look at the orderline type 

@GetString("Ecom:Order:OrderLine.Type")

You can show a list of all giftcards used using the loop for it: https://doc.dynamicweb.com/template-tags/ecommerce/shopping-cart/receipt/usedgiftcards

You can also see all product prices and discounts in the template, so just render it out. 9.6 holds a number of new tags for totals, subtotals, discount totals etc. that might be useful - see attached template for examples.

 

You must be logged in to post in the forum