当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 2 Fork 1

fotomxq / FTM-CMS
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
shop.php 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
fotomxq 提交于 2013-08-04 22:49 . 修正异常
<?php
/**
* 购物车
* @author fotomxq <fotomxq.me>
* @version 1
* @package page
*/
require('page.php');
//强制不生成缓冲
$smarty->caching = false;
//引入并声明product类
require(DIR_LIB . DS . 'sys-product.php');
$sysProduct = new SysProduct($coreDB, $sysLog);
//引入并声明order类
require(DIR_LIB . DS . 'sys-order.php');
$sysOrder = new SysOrder($coreDB, $sysLog, $coreSession, $sysProduct);
//获取当前购买清单
$buyList = null;
$buyPrice = 0;
$buys = $sysOrder->getBuy();
if ($buys) {
foreach ($buys as $v) {
$vRes = $sysProduct->get($v);
if ($vRes) {
$buyList[] = $vRes;
$buyPrice = $buyPrice + $vRes['pt_price'];
}
}
}
//订单状态
$messageKey = 0;
if (isset($_GET['msg']) == true) {
if ($_GET['msg'] == 'order-success') {
$messageKey = 1;
} else {
$messageKey = 2;
}
}
//注册变量
$smarty->assign('buyList', $buyList);
$smarty->assign('buyPrice', $buyPrice);
$smarty->assign('messageKey', $messageKey);
//输出页面
$smarty->display('shop.tpl');
?>
PHP
1
https://gitee.com/fotomxq/ftm-cms.git
git@gitee.com:fotomxq/ftm-cms.git
fotomxq
ftm-cms
FTM-CMS
master

搜索帮助