ecshop/template/goods.dwt

商品模板

Head

{$page_title}

包含脚本文件 {insert_scripts files='common.js'}

Javascript

function $id(element) 用ID取得Element
function reg(str) 切屏—是按钮,_v是内容平台,_h是内容库
  • 对str_b的Element中的H2,加点击操作,点击时做一下操作
    • 内容平台的innerHTML设置成内容库的blockquote相应H2的innerHTML
    • 除ison以外,将其他的H2的className设置成h2bg
  • 设置str_h的className为none
  • 设置str_v的innerHTML为str_h.blockquote[0].innerHTML

"/library/cart.lbi"

{insert_scripts files='transport.js'}

id=ECS_CARTINFO

{insert name='cart_info'}

"/library/category_tree.lbi" id=category_tree

{$cat.url} {$cat.name|escape:html}

{$child.url} {$child.name|escape:html}

{$childer.url} {$childer.name|escape:html}

"/library/goods_related.lbi" {$lang.releate_goods}

{$releated_goods_data.url}
{$releated_goods_data.goods_thumb}
{$releated_goods_data.goods_name}

{$releated_goods_data.url}
{$releated_goods_data.goods_name}
{$releated_goods_data.short_name}

{$lang.promote_price}
{$releated_goods_data.formated_promote_price}

{$lang.shop_price}
{$releated_goods_data.shop_price}

"/library/goods_fittings.lbi" {$lang.accessories_releate}

{$goods.url}
{$goods.goods_thumb}
{$goods.name|escape:html}

{$goods.url}
{$goods.goods_name|escape:html}
{$goods.short_name|escape:html}
{$lang.fittings_price}
{$goods.fittings_price}

"/library/goods_article.lbi" {$lang.article_releate} 相关文章

{$article.url}
{$article.title|escape:html}
{$article.short_title|escape:html}

"/library/goods_attrlinked.lbi" 属性关联的商品

{$linked.title}
{$linked.title|truncate:11:"…":true}

{$linked_goods_data.url}
{$linked_goods_data.goods_thumb}
{$linked_goods_data.name|escape:html}

{$linked_goods_data.url}
{$goods.linked_goods_data_name|escape:html}
{$linked_goods_data.short_name|escape:html}

{$lang.shop_price}
{$linked_goods_data.shop_price}

"/library/history.lbi" 左边广告区域

id="goodsInfo" 商品详情

class="imgInfo" 商品图片和相册

window.open('gallery.php?id={$goods.goods_id}')
{$goods.goods_img}
{$goods.goods_name|escape:html}

{$goods.goods_img}
{$goods.goods_name|escape:html}

"/library/goods_gallery.lbi" 相册

商品相册下广告

textInfo

form ECS_FORMBUY
addToCart({$goods.goods_id})

{$goods.goods_style_name}

{$prev_good.url}
{$next_good.url}

$promotion {$lang.activity} 优惠活动

<a href="snatch.php">{$lang.snatch}

<a href="group_buy.php">{$lang.group_buy}

<a href="auction.php">{$lang.auction}

<a href="activity.php>{$lang.favourable}

<a href="{$item.url}">{$lang.$item.type} {$item.act_name}{$item.time}

$cfg.show_goodssn 显示商品货号
{$goods.goods_sn}

$cfg.show_goodsnumber 商品库存
{$lang.goods_number}
{$lang.stock_up}

{$lang.goods_number}
{$goods.goods_number} {$goods.measure_unit}

$cfg.show_brand 显示商品品牌
{$lang.goods_brand}
{$goods.goods_brand_url}
{$goods.goods_brand}

$cfg.show_goodsweight 商品重量
{$lang.goods_weight} {$goods.goods_weight}

$cfg.show_addtime 上架时间
{$lang.add_time} {$goods.add_time}

点击数
{$lang.goods_click_count} {$goods.click_count}

$cfg.show_marketprice 市场价格
{$lang.market_price} {$goods.market_price}

本店售价
{$lang.shop_price} {$goods.shop_price_formated}

$rank_prices 会员等级对应的价格
{$rank_price.rank_name} {$rank_price.price}

{$lang.goods_rank}
images/stars{$goods.comment_rank}.gif
comment rank {$goods.comment_rank}

$volume_price_list

{$lang.volume_price}
{$lang.number_to}
{$lang.preferences_price}

$volume_price_list
{$price_list.number}
{$price_list.format_price}

$goods.is_promote 促销
{insert_scripts files='lefttime.js'}

{$lang.promote_price}
{$goods.promote_price}

{$lang.residual_time}
{$lang.please_waiting}

{$lang.amount}
id="ECS_GOODS_AMOUNT"

$goods.give_integral 购买此商品赠送积分
{$lang.goods_give_integral}
{$goods.give_integral} {$points_name}

$goods.bonus_money 红包
{$lang.goods_bonus}
{$goods.bonus_money}

{$lang.number}
changePrice()

$cfg.use_integral 购买此商品可使用积分
{$lang.goods_integral}
{$goods.integral} {$points_name}

$goods.is_shipping 为免运费商品则显示
{$lang.goods_free_shipping}

开始循环所有可选属性
$specification
{$spec.name}

判断属性是复选还是单选

$spec.values
spec_value_{$value.id}
spec_{$spec_key}
{$value.id}
spec_value_{$value.id}
changePrice()

{$value.label}
{if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if}
{$value.format_price|abs}

spec_{$spec_key}
changePrice()

{$value.label}
{$value.id}

{$value.label} {if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if}{if $value.price neq 0}{$value.format_price}{/if}

spec_value_{$value.id}
spec_{$spec_key}
{$value.id}
spec_value_{$value.id}
changePrice()

{$value.label} [{if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if} {$value.format_price|abs}]

addToCart({$goods.goods_id})
collect({$goods.goods_id})

$affiliate.on

<a href="user.php?act=affiliate&goodsid={$goods.goods_id}">

商品描述,商品属性

{$lang.goods_brief}

{$lang.goods_attr}

$package_goods_list
{$lang.remark_package}

{$goods.goods_desc}

$properties
{$key|escape}

$property_group
{$property.name|escape:html}

{$property.value}

$package_goods_list
{$package_goods.act_name}

<a href="goods.php?id={$goods_list.goods_id}">
{$goods_list.goods_name}{$goods_list.goods_attr_str}
{$goods_list.goods_number}

{$lang.old_price} {$package_goods.subtotal} {$lang.package_price} {$package_goods.package_price}
{$lang.then_old_price} {$package_goods.saving}

addPackageToCart({$package_goods.act_id})
{$lang.add_to_cart}

reg("com")

"/library/goods_tags.lbi" 右边可编辑区域

{$lang.goods_tag}
submitTag(this)

标记 $tags

<a href="search.php?keywords={$tag.tag_words|escape:url}">

{$tag.tag_words|escape:html}[{$tag.tag_count}

{$goods.goods_id}

{literal}

Javascript

function submitTag(frm) 用户添加标记的处理函数

Ajax.call user.php?act=add_tag&id=idx&tag=tag, submitTagResponse

function submitTagResponse(result)

id=ECS_TAGS

<a href="search.php?keywords='+tags[i].word+tags[i].word + '[' + tags[i].count + ']</a>

"/library/bought_goods.lbi"

$bought_goods
{$lang.shopping_and_other}

$bought_goods

class=goodsItem

{$bought_goods_data.url}

{$bought_goods_data.goods_thumb}
{$bought_goods_data.goods_name}

{$bought_goods_data.url}
{$bought_goods_data.goods_name}
{$bought_goods_data.short_name}

{$bought_goods_data.formated_promote_price}
{$bought_goods_data.shop_price}

"/library/bought_note_guide.lbi"

{insert_scripts files='transport.js,utils.js'}

ECSHOP 提醒您:动态载入bought_notes.lbi,显示当前商品的购买记录

{insert name='bought_notes' id=$id}
"/library/comments.lbi"
{insert_scripts files='transport.js,utils.js'}

ECSHOP 提醒您:动态载入comments_list.lbi,显示评论列表和评论表单
{insert name='comments' type=$type id=$id}

"/library/help.lbi"

友情链接

开始图片类型的友情链接
$img_links

{$link.url}
{$link.name}

{$link.logo}
{$link.name}

开始文字类型的友情链接
$txt_links

{$link.url}
{$link.name}

结束文字类型的友情链接

友情链接

"/library/page_footer.lbi"

Javascript

onload
changePrice();
fixpng();

changePrice() 点选可选属性或改变数量时修改商品价格的函数
changePriceResponse(res) 接收返回的信息