Show Order Total on mini cart rather than Product Total

General ShopSite user discussion

Show Order Total on mini cart rather than Product Total

Postby twlontz » Thu Mar 01, 2012 2:33 pm

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>
twlontz
 
Posts: 12
Joined: Thu Oct 06, 2011 1:17 pm

Re: Show Order Total on mini cart rather than Product Total

Postby Jim » Fri Mar 02, 2012 8:15 am

I don't believe it is possible to to show the entire cart total. The shopper would have to have selected a zip code and country inorder for shipping and tax values to have been calculated and that is only done on the shopping cart screen itself.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 53 guests