getCount("products"); $cart = new Cart(); $nrOfItemsInCart = $cart->nrOfItems(); if($nrOfItemsInCart>0) { $smarty->assign("nrofitemsincart", $nrOfItemsInCart); } $smarty->assign("totalorderprice", $cart->getCartTotal()); $productssb = $cart->getProducts(); $smarty->assign("pagetitle", "Online L-Arginine bestellen"); $smarty->assign("pagedescription", "Op L-Aginine.nl bestel je betrouwbaar en goedkoop. Lees ook informatie en arvaringen op onze site."); $categories = new Categories(); $smarty->assign("cats", $categories->getCategories()); $catarray = $categories->getCategories(); //foreach($catarray as $cat) { $products1 = Array(); $products = Array(); $catproduct = Array(); $catid = $cat['id']; //$products1 = $db->getRows("products", "WHERE `cat` = '$catid' ORDER BY `id` DESC LIMIT 0,4"); //$products1 = $db->getRows("products", " ORDER BY RAND() DESC LIMIT 0,28"); $products1 = $db->getRows("products", "WHERE `available`>0 ORDER BY RAND() DESC LIMIT 0,28"); foreach($products1 as $prod) { $p = new Product($prod['id']); $products[] = $p->getData(); } $catproduct['products'] = $products; $catproduct['title'] = $cat['title']; $catproduct['urltitle'] = $cat['urltitle'] . ".html"; $catproducts[] = $catproduct; //} $smarty->assign("catproducts", $catproducts); $smarty->assign("products", $products); $smarty->assign("productssb", $productssb); $smarty->assign("ishome", "true"); $db->__destruct(); $categories->__destruct(); $smarty->display('index.tpl'); ?>