Location: PHPKode > scripts > PHPMass Shopping Cart > phpmass-shopping-cart/user/savedcarts.php
<?php
/******************************************************************
 * PHPMass Shopping Cart
 * The contents of this file are subject to the PHPMass License. 
 * If you do not agree with PHPMass License Terms and Conditions 
 * than you should not use this software.
 * A copy of the license file is available on www.phpmass.com/license.htm page.
 * 
 * PHPMass.com.
 * All Rights Reserved.
 ******************************************************************/
$SiteSection = 'user';
require('../includes/config.php');
// Cart and top products
$LastProducts = $Carts->getLastProducts();
if (is_array($LastProducts)) {
	$LastProduct = array_shift($LastProducts);
}
$smarty->assign('LastProduct', $LastProduct);
$smarty->assign('LastProducts', $LastProducts);

$TopProducts = $Categories->getTopProducts(0,false,true);
$smarty->assign('TopProducts', $TopProducts);

// END Cart and top products
if (isset($_GET['deleteCart'])) {
	$Carts->deleteSavedCart($userid,$_GET['deleteCart']);
	$InfoMessage['Cart_Deleted'] = $Lang['Cart_Deleted'];
}
if (isset($_GET['ViewCart'])) {
	$CartDetails = $Carts->getCart($userid,$_GET['ViewCart']);

	$ProductsCart = $Carts->getProductsCart($CartDetails['wishlistid']);

	$smarty->assign('CartDetails', $CartDetails);
	$smarty->assign('ProductsCart', $ProductsCart);

	$smarty->assign('GET', $_GET);

	$smarty->assign('PageTitle', $Lang['Saved_Carts']);
	$smarty->assign('Error', $Error);
	$smarty->assign('InfoMessage', $InfoMessage);

	$smarty->display(DOC_ROOT.'/skin/templates/user/'.'wishlist.tpl');
}
else {
	if(isset($_GET['PageID'])) $Page = $_GET['PageID']; else $Page = 1;
	// Products Array in this Category/in Root category
	$Carts = $Users->getSavedCarts($userid,$Page);
	$smarty->assign('Carts', $Carts);

	//Total carts
	$TotalCarts = $Users->countSavedCarts();
	if ($TotalCarts == 0) $InfoMessage['No_Carts_Found'] = $Lang['No_Carts_Found'];
	$smarty->assign('TotalCarts', $TotalCarts);

	// Curent URL for POST unmodified and for GET without the page number
	$CurentURL = $_SERVER[REQUEST_URI];
	$smarty->assign('URL', $CurentURL);
	$smarty->assign('CurentURL', removeFilterFromURL($CurentURL,'page'));

	// Pages Array with URL, pageID, IsHref
	$PagesHtmlArr = makePagesURLs($CurentURL,$TotalCarts,$Page);
	$smarty->assign('PagesHtmlArr', $PagesHtmlArr);


	$smarty->assign('PageTitle', $Lang['Saved_Carts']);
	$smarty->assign('Error', $Error);
	$smarty->assign('InfoMessage', $InfoMessage);

	$smarty->display(DOC_ROOT.'/skin/templates/user/'.'wishlist.tpl');
}
?>
Return current item: PHPMass Shopping Cart