Developer forum

Forum » Templates » XSLT Cart Template, product loop missing

XSLT Cart Template, product loop missing

Michael Nielsen
Reply
I have the following xslt for a small cart (just outputting the xml for now). But the products loop is missing from the xml, so what am I doing wrong here?
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:param name="html-content-type"/>
<xsl:variable name="availableloops" select="'Products'" />
  <xsl:template match="/Template">
        <textarea>
    <xsl:copy-of select="." />
    </textarea>
    </xsl:template>
</xsl:stylesheet>


Replies

 
Nicolai Høeg Pedersen
Reply
The cart does not have a Products loop - it has an Orderlines loop:
http://templates.dynamicweb-cms.com/eCommerce/Dynamicweb-eCommerce-template-tags/Shopping-Cart-V2/Order/Cart/Loops/Orderlines.aspx

Each item in the orderline loop has some product tags.

 
Michael Nielsen
Reply
D'oh... Of course...

But unfortunately replacing Products with Orderlines in availableloops doesn't change anything. The following loops are in the xml data

StepButtons
Ecom:NAVConnector:Messages
ValidationErrors
Countries
Paymethods
Shippingmethods
MissingProducts

But no Orderlines.

 
Nicolai Høeg Pedersen
Reply
...and I assume that you added products to the cart?

Otherwise I need a link to see what is going on.

 
Michael Nielsen
Reply
Hi Nicolai

Yes I've added products to the cart, but even if I had not, should the loop Orderlines not be present anayway but just empty?

But it can be seen on this page, the text-area holds the xml data

http://worldtv.net.dynamicweb-cms.com/tv-pakker/Nordisk-TV-Pakke.aspx

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
The loop is called OrderLines and not Orderlines - that is why. There is an error in the documentation. I've changed your xslt template to the right casing, so now it is there.

You can always do like this to see all the loops available:
<xsl:variable name="availableloops" select="'*'" />


Votes for this answer: 0
 
Michael Nielsen
Reply
Thanks a million... :-)
 
Lars Jensen
Reply
 Iam so Happy!!


 

You must be logged in to post in the forum