ECSHOP系統(tǒng),在購(gòu)物車頁(yè)面,是可以顯示商品縮略圖的,但是ECSHOP在訂單提交的頁(yè)面卻不支持顯示縮略圖,好在ECSHOP是開(kāi)源的,通過(guò)以下方法可以實(shí)現(xiàn):(修改前備份文件,以免出錯(cuò)無(wú)法挽回)
步、打開(kāi) include/lib_order.php 文件,查找以下代碼:
/** * 取得購(gòu)物車商品 * @param int $type 類型:默認(rèn)普通商品 * @return array 購(gòu)物車商品數(shù)組 */function cart_goods($type = CART_GENERAL_GOODS){ $sql = "SELECT rec_id, user_id, goods_id, goods_name, goods_sn, goods_number, " . "market_price, goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, is_shipping, " . "goods_price * goods_number AS subtotal " . "FROM " . $GLOBALS['ecs']->table('cart') . " WHERE session_id = '" . SESS_ID . "' " . "AND rec_type = '$type'"; $arr = $GLOBALS['db']->getAll($sql); /* 格式化價(jià)格及禮包商品 */ foreach ($arr as $key => $value) { $arr[$key]['formated_market_price'] = price_format($value['market_price'], false); $arr[$key]['formated_goods_price'] = price_format($value['goods_price'], false); $arr[$key]['formated_subtotal'] = price_format($value['subtotal'], false); if ($value['extension_code'] == 'package_buy') { $arr[$key]['package_goods_list'] = get_package_goods($value['goods_id']); } } return $arr;}
替換為以下代碼(注意備份):
/** * 取得購(gòu)物車商品 * @param int $type 類型:默認(rèn)普通商品 * @return array 購(gòu)物車商品數(shù)組 */function cart_goods($type = CART_GENERAL_GOODS){ $sql = "SELECT rec_id, user_id, goods_id, goods_name, goods_sn, goods_number, " . "market_price, goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, is_shipping, " . "goods_price * goods_number AS subtotal " . "FROM " . $GLOBALS['ecs']->table('cart') . " WHERE session_id = '" . SESS_ID . "' " . "AND rec_type = '$type'"; $arr = $GLOBALS['db']->getAll($sql); /* 格式化價(jià)格及禮包商品 */ foreach ($arr as $key => $value) { /* LONGHTML 增加是否在購(gòu)物車?yán)镲@示商品圖 */ if (($GLOBALS['_CFG']['show_goods_in_cart'] == "2" || $GLOBALS['_CFG']['show_goods_in_cart'] == "3") && $row['extension_code'] != 'package_buy') { $goods_thumb = $GLOBALS['db']->getOne("SELECT `goods_thumb` FROM " . $GLOBALS['ecs']->table('goods') . " WHERE `goods_id`=".$arr[$key]['goods_id']); $arr[$key]['goods_thumb'] = get_image_path($arr[$key]['goods_id'], $goods_thumb, true); } // END $arr[$key]['formated_market_price'] = price_format($value['market_price'], false); $arr[$key]['formated_goods_price'] = price_format($value['goods_price'], false); $arr[$key]['formated_subtotal'] = price_format($value['subtotal'], false); if ($value['extension_code'] == 'package_buy') { $arr[$key]['package_goods_list'] = get_package_goods($value['goods_id']); } } return $arr;}
第二步:修改 themes/XXX/flow.dwt 文件; "XXX"為所選擇的模板目錄。
查找: