Knowledgebase

Home » Item #933

Double quantities added to basket when using Mozilla Firefox

Item: #933
Date: 2 Jul 2006
Applies to
v3
v4
v5
v6

Question

When using Mozilla Firefox, items added to the basket have their quantities doubled. For example, if I add one item, two appear in the basket.

Answer

There appears to be a bug in Firefox that causes this strange behaviour. It seems to be related to the handling of character set declarations though in some cases a comment block in the HTML that is slightly misformed seems to trigger the issue.

To resolve the issue, first check your template and in particular the comments near the top.

For example the following could trigger the error:

<!---
comment goes here
---->

Edit your skin template and ensure that the comment is opened and closed as follows (paying close attention to the number of dashes):
<!--
comment goes here
-->


If you are still experiencing problems, there is an alternative solution that seems to work. The charset declaration near the top of the skin HTML appears to cause Firefox problems in some cases:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

This meta tag sets the encoding, however because it is only part way down the page, it is not 100% reliable. Only parts of the page after this can be dealt with in the correct encoding type, prior to this the browser has to guess, and typically assumes ASCII encoding until this point.

Consequently, a safer way to set the encoding for pages is to write HTTP headers as these are received before any of the visible HTML code.

ASP makes it simple to write these - you can add the following lines near the top of your config.asp file:
response.ContentType = "text/html"
response.Charset = "windows-1252"

You can then remove the charset declaration meta tag from your skin.

The error only affects Mozilla browsers (including Netscape and Firefox). Internet Explorer and Opera seem to be unaffected.

Thanks to Rob at Cube Connection for contributing to this solution.

Can't find the answer you need? Click here to open a support ticket.

« Back