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

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

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

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

ECSHOP系統(tǒng),在購物車頁面,是可以顯示商品縮略圖的,但是ecshop在訂單提交的頁面卻不支持顯示縮略圖,好在ECSHOP是開源的,通過以下方法可以實現(xiàn):(修改前備份文件,以免出錯無法挽回)
步驟一、打開 include/lib_order.php 文件,查找以下代碼:
/** * 取得購物車商品 * @param int $type 類型:默認普通商品 * @return array 購物車商品數(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); /* 格式化價格及禮包商品 */ 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; }
替換為以下代碼(注意備份):
/** * 取得購物車商品 * @param int $type 類型:默認普通商品 * @return array 購物車商品數(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); /* 格式化價格及禮包商品 */ foreach ($arr as $key => $value) { /* LONGHTML 增加是否在購物車里顯示商品圖 */ 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é)算提交訂單頁面顯示商品縮略圖的方法(圖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é)算提交訂單頁面顯示商品縮略圖的方法(圖2)
后臺刷新緩存就可以了

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

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

標簽: ecshop購物車  
相關(guān)文章
推薦文章
模板推薦