I am using the JavaScript mini cart code on my page. How do I change the below portion of the code to display the Order Total rather than just the Product Total?
cartvalues = unescape(cookies.substring(start,end)); //read in just the cookie data
start = 0;
while ((start = cartvalues.indexOf("|", start)) != -1)
{
start++;
end = cartvalues.indexOf("|", start);
if (end != -1)
{
linecount++;
if (linecount == 2) // Total Quantity of Items
{
tmp = cartvalues.substring(start,end);
colon = tmp.indexOf(":", 0);
document.write("<a href=\"" + cartURL + "\" style=\"color:" + linkColor + "\">");
document.write(tmp.substring(colon+1,end - start));
if ((tmp.substring(colon+1,end - start)) == 1 )
{
document.write(" Item");
}
else
{
document.write(" Items");
}
document.write(": ");
}
if (linecount == 3) // Product Subtotal CHANGE THIS TO DISPLAY ORDER TOTAL
{
tmp = cartvalues.substring(start,end);
colon = tmp.indexOf(":", 0);
document.write(tmp.substring(colon+1,end - start));
document.write("</a>");
}
start = end;
}
else
{
break;
}
} // end while loop
//close minicart HTML
document.write("</div>\n");
}
</script>