花魁直播高品质美女在线视频互动社区 - 花魁直播官方版

 歡迎來(lái)到素材無(wú)憂網(wǎng),按 + 收藏我們
登錄 注冊(cè) 退出 找回密碼

ecshop結(jié)算頁(yè)購(gòu)物車提交訂單頁(yè)面顯示商品縮略圖的方法

時(shí)間: 2024-02-25 10:43 閱讀: 作者:素材無(wú)憂網(wǎng)

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"為所選擇的模板目錄。
查找:

{$lang.goods_list}{$lang.modify}
{$lang.goods_name} {$lang.goods_attr} {$lang.market_prices} {if $gb_deposit}{$lang.deposit}{else}{$lang.shop_prices}{/if} {$lang.number} {$lang.subtotal}
{$goods.goods_name}({$lang.remark_package}) {$goods.goods_attr|nl2br} {$goods.formated_market_price} {$goods.formated_goods_price} {$goods.goods_number} {$goods.formated_subtotal}
{$your_discount}
{$shopping_money},{$market_price_desc}

替換為:
{$lang.goods_list}{$lang.modify}
商品圖片 {$lang.goods_name} {$lang.goods_attr} {$lang.market_prices} {if $gb_deposit}{$lang.deposit}{else}{$lang.shop_prices}{/if} {$lang.number} {$lang.subtotal}
ecshop結(jié)算頁(yè)購(gòu)物車提交訂單頁(yè)面顯示商品縮略圖的方法(圖1) {$goods.goods_name}({$lang.remark_package}) {$goods.goods_attr|nl2br} {$goods.formated_market_price} {$goods.formated_goods_price} {$goods.goods_number} {$goods.formated_subtotal}
{$your_discount}
{$shopping_money},{$market_price_desc}

第二步也可以不用這樣替換,你可以自己使用以下商品圖片調(diào)用代碼,在自己想要顯示的位置插入代碼就行了:
ecshop結(jié)算頁(yè)購(gòu)物車提交訂單頁(yè)面顯示商品縮略圖的方法(圖2)
{$goods.goods_thumb}就是商品縮略圖

版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!

轉(zhuǎn)載請(qǐng)注明: ecshop結(jié)算頁(yè)購(gòu)物車提交訂單頁(yè)面顯示商品縮略圖的方法

標(biāo)簽: ecshop結(jié)算頁(yè)  
相關(guān)文章
推薦文章
模板推薦