ecshop/goods.php

商品详情

ecshop/includes/init.php

!(DEBUG_MODE & 2) then $smarty->caching = true

smarty->affiliate = $GLOBALS['_CFG']['affiliate']

INPUT $goods_id = $_REQUEST['id']

改变属性、数量时重新计算商品价格

$_REQUEST['act'] == 'price' then
include ecshop/includes/cls_json.php

$_REQUEST['attr']
$_REQUEST['number']

$shop_price = get_final_price($goods_id, $number, true, $attr_id)
$res['result'] = price_format($shop_price * $number)

$json->encode($res)

商品购买记录ajax处理

$_REQUEST['act'] == 'gotopage' then
include ecshop/includes/cls_json.php

$_REQUEST['id']
$_REQUEST['page']

取得商品购买记录 $bought_notes tab:order_info, users, order_goods
商品购买记录分页样式

smarty fecth ecshop/library/bought_notes.lbi

$json->encode($res)

PROCESSOR

check is cached ecshop/template/goods.dwt

smarty variables:
image_width
image_height
helps 网店帮助
id
type
cfg
promotion 促销信息
promotion_info

获得商品的信息 get_goods_info($goods_id), 如果没有找到任何记录则跳回到首页
$goods['goods_brand_url']
$goods['goods_style_name']

购买该商品可以得到多少钱的红包 tab:bonus_type
price_format($goods['bonus_money'])

smarty variables:
goods
goods_id
promote_end_time
categories = get_categories_tree($goods['cat_id'])

keywords
description

get_parent_cats($goods['cat_id'])
assign_template('c', $catlist)

上一个商品下一个商品 tab:goods
smarty variables:
prev_good
next_good

assign_ur_here
current position
page_title 页面标题
ur_here 当前位置

获得商品的规格和属性
get_goods_properties($goods_id)

smarty variables:
properties
specification
attribute_linked
related_goods
goods_article_list
fittings
rank_prices
pictures
bought_goods
goods_rank

获取tag get_tags($goods_id)
获取关联礼包 get_package_goods_list($goods['goods_id'])

商品优惠价格区间
assign_dynamic('goods');

记录浏览历史

更新点击次数

PRIVATE FUNCTION

get_linked_goods($goods_id) 获得指定商品的关联商品 tab:link_goods, goods, member_price
get_linked_articles($goods_id) 获得指定商品的关联文章 tab:goods_article, article