您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop订单页面显示商品缩略图的实现方法

寒云2025-01-10 13:47:16ecshop商城教程已有人查阅

导读Ecshop购物流程 checkout(结算)步骤,不显示商品缩略图;购物是否显示商品缩略图,后台商店设置可以控制。稍稍改造一下,可以让checkout(结算)步骤,显示商品缩略图。

Ecshop购物流程 checkout(结算)步骤,不显示商品缩略图;购物是否显示商品缩略图,后台商店设置可以控制。稍稍改造一下,可以让checkout(结算)步骤,显示商品缩略图。
1、修改include/lib_order.php库文件中的cart_goods()函数。 请做好备份喔!
/**
* 取得购物车商品
* @param int $type 类型:默认普通商品
* @return array 购物车商品数组
*/
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;
}
2、修改themes/XXX/flow.dwt文件; “XXX”为所选择的模板主题。 请做好备份喔!

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签