Developer forum

Forum » Templates » Ecom: emptycart

Ecom: emptycart


Reply

Hi,

 

How could you set up an ecom, in such way that a specific code/template is displayed when no items are in the cart?

 

I have included a paragraph containing a cart module in the paragraphsetup file, for rendering on every page. But when you setup a standard cart it will not render any template when no items are added, but I want to display an advanced "no items in your cart" text.

 

One - ugly - way around this could be to put most of the cart html in the page or paragraphsetup template, but in this design the cart design is so "advanced" that this is not an option.

 

Thanks in advance

 

Regin Jæger Madsen

Norriq


Replies

 
Reply
rjm wrote:

Hi,

 

How could you set up an ecom, in such way that a specific code/template is displayed when no items are in the cart?

 

I have included a paragraph containing a cart module in the paragraphsetup file, for rendering on every page. But when you setup a standard cart it will not render any template when no items are added, but I want to display an advanced "no items in your cart" text.

 

One - ugly - way around this could be to put most of the cart html in the page or paragraphsetup template, but in this design the cart design is so "advanced" that this is not an option.

 

Thanks in advance

 

Regin Jæger Madsen

Norriq

..so...no solution for this or?

 
Reply

Sorry for the missing answers. I'd use If Defined and match one of the cart tags for content. The If Defined would display the cart when lines are present, and the If Not Defined would display the "No items in the cart" message. Use @DwTemplateTags for a list of cart tags available in the page template.

 
Reply
Sorensen wrote:

Sorry for the missing answers. I'd use If Defined and match one of the cart tags for content. The If Defined would display the cart when lines are present, and the If Not Defined would display the "No items in the cart" message. Use @DwTemplateTags for a list of cart tags available in the page template.

 

Thanks for your answer.

 

Since my cart is located in an paragraph, I can not use that approach, since no cart tags are available in an paragraph.

 

Insted I inserted a small style script that simply set display:none to a div layer in the paragraph, holding the emptycart code...

 

I think it would be a nice feature if you could have a "noitems in cart" template... More or less every ecom solution uses a small cart on every page, and this would make it easier to handle...

 

Regin Madsen

 
Reply

Oh, ok, I thought you meant the cart feature in the page template. Well, since this is on the paragraph containing the cart, why not use the "Empty shopping cart" feature in the paragraph settings and point out a page that will be displayed when the user chooses to view the basket, and there are no items in it?

 
Reply
Sorensen wrote:

Oh, ok, I thought you meant the cart feature in the page template. Well, since this is on the paragraph containing the cart, why not use the "Empty shopping cart" feature in the paragraph settings and point out a page that will be displayed when the user chooses to view the basket, and there are no items in it?

cant do that, cause that will simply forward me to that page, and thats not what im interested in.

 

This cart is used only to display the number of items in the cart (and located at the top of each page) -standard webshop way. So if theres 0 items in the cart it shold say "no items in cart".

 

 

But what I can understand from your answers is that there is no kind of "use this carttemplate if the cart is empty" - and I guess that would make a whole lot of hoolahops unneccesary.

 

 

But Iwe found another solution so its not an issue in this case anymore ;-)

 
Reply

Something like the top right corner on this page? http://www.imerco.dk/

 
Reply

how about:

 <script type="text/javascript">
  var x="<!--@Ecom:Order.OrderLines.Count-->";
  if (x.substring(0,1) == '<') document.write('0')
  else  document.write(x);
  </script>
 

 

 

You must be logged in to post in the forum