DJuse
May 5th 2008, 9:59 am
I have this piece of code; what it does is that when user press a button, the item is added to the shopping cart. I use the onClick even't for this, its working perfectly on IE, however no on Firefox or related browsers.
Does anyone have any idea what this may be?
I looked around the net for this problem, and found a lot of people with the same problem, but no a definitive solution.
Thanks for the help!
<?
if ($productrow['status']) {
if ($productrow['type'] == 0 && ($isMember || $isAdmin)) {
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
echo "<img src='$addtocart_button' border=0>";
echo "</a>";
echo "<a href='".FILE_DOWNLOAD."?productID=".$productrow['productID']."'>";
echo "<img src='$download_button' border=0>";
echo "</a>";
} else if ($productrow['type'] == 0 && (!$isMember && !$isAdmin)) {
echo "<b>Member Download Only</b>";
} else if ($productrow['type'] == 1 || $productrow['type'] == 2) {
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
echo "<img src='$addtocart_button' border=0>";
echo "</a>";
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\");self.location.replace(\"".FILE_INDEX."?action=checkout\")'>";
echo "<img src='$buy_button' border=0>";
echo "</a>";
}
} else { // product n/a for download or purchase
echo "<img src='$na_button' border=0>";
}
?>
Does anyone have any idea what this may be?
I looked around the net for this problem, and found a lot of people with the same problem, but no a definitive solution.
Thanks for the help!
<?
if ($productrow['status']) {
if ($productrow['type'] == 0 && ($isMember || $isAdmin)) {
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
echo "<img src='$addtocart_button' border=0>";
echo "</a>";
echo "<a href='".FILE_DOWNLOAD."?productID=".$productrow['productID']."'>";
echo "<img src='$download_button' border=0>";
echo "</a>";
} else if ($productrow['type'] == 0 && (!$isMember && !$isAdmin)) {
echo "<b>Member Download Only</b>";
} else if ($productrow['type'] == 1 || $productrow['type'] == 2) {
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
echo "<img src='$addtocart_button' border=0>";
echo "</a>";
echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\");self.location.replace(\"".FILE_INDEX."?action=checkout\")'>";
echo "<img src='$buy_button' border=0>";
echo "</a>";
}
} else { // product n/a for download or purchase
echo "<img src='$na_button' border=0>";
}
?>