public function __construct()
 {
     // Initialize the cart management API.
     $this->api = new ISC_CART_API();
     if (!isset($_SESSION['OFFERCART'])) {
         $_SESSION['OFFERCART'] = array();
     }
     $this->api->SetCartSession($_SESSION['OFFERCART']);
     // Setup the number of products in the cart which will be shown
     // on the header of every page of the site
     $this->SetNumItemsInCart();
     // Setup the page title
     $this->pageTitle = GetConfig('StoreName') . " - " . GetLang('ShoppingCart');
     if (isset($_SESSION['JustAddedProduct']) && $_SESSION['JustAddedProduct'] != '') {
         // Get the category of the last product added to the store
         $query = sprintf("select c.categoryid, catname from [|PREFIX|]categoryassociations ca inner join [|PREFIX|]categories c on ca.categoryid=c.categoryid where ca.productid='%d' ", $GLOBALS['ISC_CLASS_DB']->Quote((int) $_SESSION['JustAddedProduct']));
         $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 1);
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $GLOBALS['KeepShoppingLink'] = CatLinkNew($row['categoryid'], $row['catname']);
             $GLOBALS['KeepShoppingText'] = sprintf(GetLang('ClickHereToKeepShoppingCat'), isc_html_escape($row['catname']));
         }
         $_SESSION['JustAddedProduct'] = '';
     }
     // Special function used to reconvert currencies if the admin user changes the default currency while people currently have items in their cart
     RecompileOrderPrices();
 }
Example #2
0
 public function __construct()
 {
     if ($GLOBALS['EnableSEOUrls'] == 1) {
         $url_array = split('/', strtolower($_SERVER['REQUEST_URI']));
         $searchlogid = $url_array[array_search('searchlogid', $url_array, true) + 1];
     } else {
         $searchlogid = $_GET['SearchLogId'];
     }
     UpdateSearchLogforBestKeyWord($searchlogid);
     // Initialize the cart management API.
     $this->api = new ISC_CART_API();
     if (!isset($_SESSION['CART'])) {
         $_SESSION['CART'] = array();
     }
     $this->api->SetCartSession($_SESSION['CART']);
     // Setup the number of products in the cart which will be shown
     // on the header of every page of the site
     $this->SetNumItemsInCart();
     // Setup the page title
     $this->pageTitle = GetConfig('StoreName') . " - " . GetLang('ShoppingCart');
     // The default "Click here to keep shopping" text
     //commented by blessen
     //			if ($this->api->GetNumItemsInCart() > 0) {
     //				$GLOBALS['KeepShoppingText'] = GetLang('ClickHereToKeepShopping');
     //				$GLOBALS['KeepShoppingLink'] = "javascript:history.go(-1)"; // $GLOBALS['ShopPath'];
     //			} else {
     //				$GLOBALS['KeepShoppingText'] = '';
     //				$GLOBALS['KeepShoppingLink'] = ''; // $GLOBALS['ShopPath'];
     //			}
     if (isset($_SESSION['JustAddedProduct']) && $_SESSION['JustAddedProduct'] != '') {
         // Get the category of the last product added to the store
         $query = sprintf("select c.categoryid, catname from [|PREFIX|]categoryassociations ca inner join [|PREFIX|]categories c on ca.categoryid=c.categoryid where ca.productid='%d' ", $GLOBALS['ISC_CLASS_DB']->Quote((int) $_SESSION['JustAddedProduct']));
         $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 1);
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $GLOBALS['KeepShoppingLink'] = CatLinkNew($row['categoryid'], $row['catname']);
             $GLOBALS['KeepShoppingText'] = sprintf(GetLang('ClickHereToKeepShoppingCat'), isc_html_escape($row['catname']));
         }
         $_SESSION['JustAddedProduct'] = '';
     }
     // Special function used to reconvert currencies if the admin user changes the default currency while people currently have items in their cart
     RecompileOrderPrices();
 }