📄 cart.php
字号:
<?php
/*
[插件名称] 购物车 - 替换模版标签{#modCart#}
[适用范围] 全站
[文 件 名] Cart.php
[更新时间] 2007/1/13
*/
function Cart(){
global $fsql,$msql,$charset,$MenuInfo,$tbl_shop_con,$tbl_hb,$KuAlert,$lanCartNone,$CARTSTR,$lanCartNone;
global $lanOrderHbNTC1,$lanCartNTC4,$CONF,$lanOrderHbZh,$tbl_goodsprop;
$PSET=PlusSet("modCart");
$tempname=PlusDef($PSET["tempname"],"tpl_cart.htm");
if($_GET["step"]=="add"){
echo "<script>document.cookie = 'CARTREFFER=' + document.referrer</script>";
$cartback="'+ document.referrer+'";
}elseif(isset($_COOKIE["CARTREFFER"])){
$cartback=$_COOKIE["CARTREFFER"];
}else{
$cartback=ROOTPATH."shop/class/";
}
//默认货币单位
$hbname=$CONF["hbname"];
$hbdanwei=$CONF["hbdanwei"];
$hbcode=$CONF["hbcode"];
//模版解释
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$str=$TempArr["start"];
//解释购物车
$arrey=explode('#',$CARTSTR);
$tnums=sizeof($arrey)-1;
$tjine=0;
$kk=0;
for($t=0;$t<$tnums;$t++){
$fff=explode('&',$arrey[$t]);
$gid=$fff[0];
$acc=$fff[1];
$mypr=$fff[3];
$fsql->query("select * from $tbl_shop_con where id='$gid'");
if($fsql->next_record()){
$id=$fsql->f('id');
$bn=$fsql->f('bn');
$title=$fsql->f('title');
$goodstype=$fsql->f('goodstype');
$tcall=$fsql->f('tcall');
$danwei=$fsql->f('danwei');
$price0=$fsql->f('price0');
$price1=$fsql->f('price1');
$price2=$fsql->f('price2');
$price3=$fsql->f('price3');
$price4=$fsql->f('price4');
$price5=$fsql->f('price5');
$price6=$fsql->f('price6');
$price7=$fsql->f('price7');
$price8=$fsql->f('price8');
$price9=$fsql->f('price9');
$price10=$fsql->f('price10');
$price11=$fsql->f('price11');
$price12=$fsql->f('price12');
$price=NowPrice($id,$goodstype,$price1,$price2,$price3,$price4,$price5,$price6,$price7,$price8,$price9,$price10,$price11,$price12);
$jine=$price*$acc;
$jine=number_format($jine,2,'.','');
if($goodstype=="tc"){
$tcgoods=GoodsTcAll($tcall);
}else{
$tcgoods="";
}
$var=array (
'id' => $id,
'jine' => $jine,
'price' => $price,
'acc' => $acc,
'goodsname' => $title,
'tcgoods' => $tcgoods,
'prop' => $mypr,
'hbcode' => $hbcode,
'hbdanwei' => $hbdanwei,
'hbname' => $hbname,
'danwei' => $danwei,
'bn' => $bn
);
$str.=ShowTplTemp($TempArr["list"],$var);
}
$tjine=$tjine+$jine;
$kk++;
}
$tjine=number_format($tjine,2,'.','');
$end=$TempArr["end"];
if($kk<=0){
$end=str_replace("{#nonegoods#}",$lanCartNone."<br>",$end);
$visible="style='display:none'";
}
$end=str_replace("{#visible#}",$visible,$end);
$end=str_replace("{#cartback#}",$cartback,$end);
$end=str_replace("{#tjine#}",$tjine,$end);
$end=str_replace("{#hbdanwei#}",$hbdanwei,$end);
$end=str_replace("{#hbname#}",$hbname,$end);
$end=str_replace("{#hbcode#}",$hbcode,$end);
$str.=$end;
if($IfExistKucun!="1"){
$str.=$KuAlert;
}
return $str;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -