$imageurl = "<img class='product_img' src='" . $product_image . "' border='0' >";
            } elseif (is_file(BASE_URL . "/" . $prodimagedir . $product_image) && file_exists(BASE_URL . "/" . $prodimagedir . $product_image)) {
                $imageurl = "<img class='product_img' src='" . SITE_URL . "/" . $prodimagedir . $product_image . "' border='0' >";
            } else {
                $imageurl = "<img class='product_img' src='" . SITE_URL . "/" . $prodimagedir . "noimage.jpg'  >";
            }
        }
        if (strlen($row["product_name"]) > 30) {
            $prd_name = stripslashes(substr($row["product_name"], 0, 30));
        } else {
            $prd_name = stripslashes($row["product_name"]);
        }
        $price = $row['product_price'];
        $discountstr = "";
        $currency_attributes = displayCurrencyType();
        $conversionRate = ConvertedCurrencyRate($currency_attributes[2]);
        $converted_price = $price * $conversionRate;
        $discountprice = 0;
        if ($row["discount"] != "0") {
            $discountprice = $converted_price - $converted_price * $row["discount"] / 100;
            $discountprice = number_format($discountprice, 2, ".", "");
            $discountstr = "<br>discount(" . $row["discount"] . "%)";
        }
        $display_product_price = number_format($converted_price, 2, ".", "");
        $no_margin_class = $count_row == $cells ? 'nomargin' : '';
        ?>

    <div class="pcm_productitem <?php 
        echo $no_margin_class;
        ?>
">
function getUserCurrencyCartTotal($userid)
{
    global $tableprefix;
    $currency_attributes = displayCurrencyType();
    $sql = "SELECT c.*, (p.product_price+po.additional_price) AS product_price,p.product_artist_id,po.discount\n        FROM " . $tableprefix . "cart c\n        INNER JOIN " . $tableprefix . "product_options po ON po.product_option_id = c.product_option_id\n        INNER JOIN " . $tableprefix . "products p ON p.product_id = po.product_id\n        WHERE c.user_id = '" . addslashes($userid) . "' ";
    $result = mysql_query($sql);
    $total = 0;
    $itemcount = 0;
    $currency_attributes = displayCurrencyType();
    if (mysql_num_rows($result) != 0) {
        while ($row = mysql_fetch_array($result)) {
            $conversionRate = ConvertedCurrencyRate($currency_attributes[2]);
            $converted_price = $row['product_price'] * $conversionRate;
            $rate = $converted_price;
            $qty = $row["quantity"];
            $price = $qty * $rate;
            $discountstr = "";
            $discountprice = 0;
            if ($row["discount"] != "0") {
                $price = number_format($price, 2, ".", "");
                $discountprice = $rate - $rate * $row["discount"] / 100;
                $discountprice = number_format($discountprice, 2, ".", "");
                $discountrate = $discountprice * $qty;
                $price = $discountrate;
            }
            $total += $price;
        }
    }
    return $total;
}