-1
我在我的頁面上有一個顏色色板(和AVAIALBLE COLOURS色塊),我只想在數據庫中顯示結果時顯示該區域。如果找不到結果將不會顯示 -
這裏是我的代碼:
private function getWTVariationHighlights($productId, $variationId)
{
$output_str = "";
$output_str .="<div class=\"mainProductSwatchesTitle\"><b>AVAILABLE COLOURS</b>\n";
$output_str .= "<div class=\"mainProductSwatches\">\n";
$sql = "select voptionid, vovalue from [|PREFIX|]product_variation_options where vovariationid=$variationId and (voname='Colour' or voname='Color')";
$result = $this->db->Query($sql);
while ($row = $this->db->fetch($result)) {
$sql = "select * from [|PREFIX|]variation_option_highlight where variation_option_id=" . $row['voptionid'] . " and product_id=" . $productId;
$result2 = $this->db->Query($sql);
if($row2 = $this->db->fetch($result2)){
if($row2['thumb_location']){
$output_str .= "<a href=\"#\" onmouseover=\"changeMain('" . $row2['location'] . "')\"><img src=\""
. $GLOBALS['ShopPath'] . "/product_images/hfh_highlight_images/" . $row2['thumb_location'] . "\" /></a>\n";
}
}
}
$output_str .= "</div>\n";
$output_str .= "<script type=\"text/javascript\">\n";
$output_str .= "function changeMain(src)\n";
$output_str .= "{\n";
$output_str .= "document.getElementById('phthumb').src = '" . $GLOBALS['ShopPath'] . "/product_images/hfh_highlight_images/' + src;\n";
$output_str .= "}\n";
$output_str .= "</script>\n";
return $output_str;
}
SO IST主要用於具體的技術問題,一個網站。你甚至不問一個。請參閱,如果你可以提供更多的信息,究竟是什麼問題。你已經嘗試了什麼?等等 – 2012-07-21 15:03:56