Code:
products_id']) ) { if ($val > 0) { $adjust_max = false; $prodId = $key; $qty = $val; $add_max = zen_get_products_quantity_order_max($prodId); $cart_qty = $this->in_cart_mixed($prodId); // $new_qty = $qty; //echo 'I SEE actionMultipleAddProduct: ' . $prodId . '
'; $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart'); if (($add_max == 1 and $cart_qty == 1)) { // do not add $adjust_max= 'true'; } else { // adjust quantity if needed if (($new_qty + $cart_qty > $add_max) and $add_max != 0) { $adjust_max= 'true'; $new_qty = $add_max - $cart_qty; } $this->add_cart($prodId, $this->get_quantity($prodId)+($new_qty)); } if ($adjust_max == 'true') { // $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' C: - ' . zen_get_products_name($prodId), 'caution'); $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution'); } } } // display message if all is good and not on shopping_cart page if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) { $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success'); } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } } /** * Method to handle cart Action - notify * * @param string forward destination * @param url parameters */ function actionNotify($goto, $parameters) { global $db; if ($_SESSION['customer_id']) { if (isset($_GET['products_id'])) { $notify = $_GET['products_id']; } elseif (isset($_GET['notify'])) { $notify = $_GET['notify']; } elseif (isset($_POST['notify'])) { $notify = $_POST['notify']; } else { zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page')))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $check_query = "select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $check = $db->Execute($check_query); if ($check->fields['count'] < 1) { $sql = "insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $_SESSION['customer_id'] . "', now())"; $db->Execute($sql); } } // zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page')))); zen_redirect(zen_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, zen_get_all_get_params(array('action', 'notify', 'main_page')))); } else { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } /** * Method to handle cart Action - notify remove * * @param string forward destination * @param url parameters */ function actionNotifyRemove($goto, $parameters) { global $db; if ($_SESSION['customer_id'] && isset($_GET['products_id'])) { $check_query = "select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $check = $db->Execute($check_query); if ($check->fields['count'] > 0) { $sql = "delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $db->Execute($sql); } zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'main_page')))); } else { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } /** * Method to handle cart Action - Customer Order * * @param string forward destination * @param url parameters */ function actionCustomerOrder($goto, $parameters) { global $zco_page; global $messageStack; if ($_SESSION['customer_id'] && isset($_GET['pid'])) { if (zen_has_product_attributes($_GET['pid'])) { zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid'])); } else { $this->add_cart($_GET['pid'], $this->get_quantity($_GET['pid'])+1); } } // display message if all is good and not on shopping_cart page if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) { $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success'); } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - remove product * * @param string forward destination * @param url parameters */ function actionRemoveProduct($goto, $parameters) { if (isset($_GET['product_id']) && zen_not_null($_GET['product_id'])) $this->remove($_GET['product_id']); zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - user action * * @param string forward destination * @param url parameters */ function actionCartUserAction($goto, $parameters) { $this->notify('NOTIFY_CART_USER_ACTION'); } // $qty = $this->adjust_quantity($qty, (int)$products_id, 'shopping_cart'); // temporary fixed on messagestack used for check and message needs better separation function adjust_quantity($check_qty, $products, $message=false) { global $messageStack; $old_quantity = $check_qty; if (QUANTITY_DECIMALS != 0) { // $new_qty = round($new_qty, QUANTITY_DECIMALS); $fix_qty = $check_qty; switch (true) { case (!strstr($fix_qty, '.')): $new_qty = $fix_qty; // $messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution'); break; default: $new_qty = preg_replace('/[0]+$/','', $check_qty); // $messageStack->add_session('shopping_cart', 'A: ' . ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution'); break; } } else { if ($check_qty != round($check_qty, QUANTITY_DECIMALS)) { $new_qty = round($check_qty, QUANTITY_DECIMALS); $messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ERROR_QUANTITY_CHANGED_FROM . $old_quantity . ERROR_QUANTITY_CHANGED_TO . $new_qty, 'caution'); } else { $new_qty = $check_qty; } } return $new_qty; } } ?>
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/wealthuk/public_html/includes/classes/shopping_cart.php:1903) in /home/wealthuk/public_html/includes/functions/sessions.php on line 108
Warning: Cannot modify header information - headers already sent by (output started at /home/wealthuk/public_html/includes/classes/shopping_cart.php:1903) in /home/wealthuk/public_html/admin/includes/init_includes/init_templates.php on line 32
Here my website
Bookmarks