Developer forum

Forum » Templates » if/else tag. Display cart or not

if/else tag. Display cart or not


Reply

Hi!

We need to display a link to the cart on all pages. If the cart is empty we simply want it to say 'cart empty'.

Anybody know why the code below doesent work? 



<!--@If Defined(Ecom:Order.OrderLines.TotalQuantity)-->
<a class='id1' href='Default.aspx?ID=489'>Handlekurv<br/> <!--@Ecom:Order.OrderLines.TotalQuantity--> Gjenstander <br/> <!--@Ecom:Order.PriceWithoutFees--></a>
<!--@EndIf(Ecom:Order.OrderLines.TotalQuantity)-->

<!--@If Not Defined(Ecom:Order.OrderLines.TotalQuantity)-->
Cart is empty.
<!--@EndIf(Ecom:Order.OrderLines.TotalQuantity)-->

-cheers

Yogi

 


Replies

 
Reply

Hi

How about using a PARAGRAPH template looking like this:

<!--@If Defined(ParagraphModule)-->
 <!--@ParagraphModule-->
<!--@EndIf(ParagraphModule)-->
<!--@If Not Defined(ParagraphModule)-->
 Your Cart is empty
<!--@EndIf(ParagraphModule)-->
 

Then in your PAGE template you do like this:
<!--@Global:Paragraph.Content([ID])-->

Where [ID] is the ID of the paragraph with the cart module attached.
 

I think this would work.

// Dammark

 

You must be logged in to post in the forum