⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cart_view.php

📁 完善的PHP/MySQL电子商务方案
💻 PHP
字号:
<?/* cart_view.php (c) 2000 Ying Zhang (ying@zippydesign.com) * * TERMS OF USAGE: * This file was written and developed by Ying Zhang (ying@zippydesign.com) * for educational and demonstration purposes only.  You are hereby granted the  * rights to use, modify, and redistribute this file as you like.  The only * requirement is that you must retain this notice, without modifications, at * the top of your source code.  No warranties or guarantees are expressed or * implied. DO NOT use this code in a production environment without * understanding the limitations and weaknesses pretaining to or caused by the * use of these scripts, directly or indirectly. USE AT YOUR OWN RISK! *//****************************************************************************** * MAIN *****************************************************************************/include("../application.php");if (isset($func)) {	switch ($func) {		case "remove" :			$SESSION["cart"]->remove($id);			break;		case "empty" :			$SESSION["cart"]->init();			break;		case "recalc" :			update_qty($HTTP_POST_VARS);			break;	}	$SESSION["cart"]->cleanup();	$SESSION["cart"]->recalc_total();}$qid = get_cart_items();$DOC_TITLE = "Shopping Cart";include("$CFG->templatedir/header.php");include("templates/shopping_cart.php");include("$CFG->templatedir/footer.php");/****************************************************************************** * FUNCTIONS *****************************************************************************/function update_qty(&$form) {/* update the product quantities, we are expecting them in the HTTP_POST_VARS * variable because the form does a POST.  the quantities are in an array * called $qty[] and the corresponding product id's are in $id[] */	global $SESSION;	foreach ($form["id"] as $i => $productid) {		$qty = $form["qty"][$i];		$SESSION["cart"]->set($productid, $qty);	}}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -