Developer forum

Forum » Development » Show cart if empty

Show cart if empty


Reply
Hi,
I want to show the cart even when it is empty.
I included the cart in a global element that is placed on all pages. Works fine.
The only problem i have is that the full content of cart.html is not displayed when cart is empty. I want instead a alternative cart that says: your cart is empty.

How can i make this happen?
Kind regards,
Niek Brinkman

Replies

 
Reply
Hi Niek

It is not possible to render a template if the cart is empty. The only option in the cart at the moment is to redirect to a specific page if the cart is empty.

 - Lasse
 
Reply
Hi Niek Brinkman

I had the same problem but managed to solve it like this:

 - Use and If defined tag to check the globalparagraph or simply the module tag (where the shopping cart is inserted)
 - with the if Not Defined, get the global page tags for the cart

The tags for the cart can be rendered in the page template, which gives you a lot of liberty. With XSLT you can manage this very easily.

Best Regards,
Nuno
 
Reply
Hi Nuno,
Thanks, will try it.
Niek
 
Reply
Hi Nuno, 

I tried the following but it will only show Empty. Do i reference the right tag?

<!--@If Defined(Global:Ecom.Cart)--> <!--@Global:Page.Content(2665)--> <!--@EndIf(Global:Ecom.Cart)--> <!--@If Not Defined(Global:Ecom.Cart)-->
<p>Empty</p>
<!--@EndIf(Global:Ecom.Cart)-->

Best, Niek

 

You must be logged in to post in the forum