function shipping($module = '') { global $language, $PHP_SELF, $cart; // BOF: Individual Shipping Prices $shiptotal = $cart->get_shiptotal(); // EOF: Individual Shipping Prices if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) { $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); $include_modules = array(); if (tep_not_null($module) && in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) { $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1)); } else { reset($this->modules); // BOF: Individual Shipping Prices // Show either normal shipping modules or Individual shipping module when Individual Shipping Module is On // Show Individual Shipping Only if (tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS') and $shiptotal) { $include_modules[] = array('class' => 'indvship', 'file' => 'indvship.php'); } else { // All Other Shipping Modules while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); // Don't show Individual Shipping Module if ($class != 'indvship') { $include_modules[] = array('class' => $class, 'file' => $value); } } } // EOF: Individual Shipping Prices } for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) { include DIR_FS_CATALOG_LANGUAGES . $language . '/' . $include_modules[$i]['file']; include DIR_FS_CATALOG_MODULES . 'shipping/' . $include_modules[$i]['file']; $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'](); } } }
function payment($module = '') { // LINE CHANGED: MOD - Downloads Controller - Added $cart global $payment, $language, $PHP_SELF, $cart; // Start - CREDIT CLASS Gift Voucher Contribution if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && $module != 'credit_covers') { // End - CREDIT CLASS Gift Voucher Contribution // BOF: MOD - Separate Pricing Per Customer, next line original code // $this->modules = explode(';', MODULE_PAYMENT_INSTALLED); global $sppc_customer_group_id, $customer_id; if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $customer_payment_query = tep_db_query("select IF(c.customers_payment_allowed <> '', c.customers_payment_allowed, cg.group_payment_allowed) as payment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'"); if ($customer_payment = tep_db_fetch_array($customer_payment_query)) { if (tep_not_null($customer_payment['payment_allowed'])) { $temp_payment_array = explode(';', $customer_payment['payment_allowed']); $installed_modules = explode(';', MODULE_PAYMENT_INSTALLED); for ($n = 0; $n < sizeof($installed_modules); $n++) { // check to see if a payment method is not de-installed if (in_array($installed_modules[$n], $temp_payment_array)) { $payment_array[] = $installed_modules[$n]; } } // end for loop $this->modules = $payment_array; } else { $this->modules = explode(';', MODULE_PAYMENT_INSTALLED); } } else { // default $this->modules = explode(';', MODULE_PAYMENT_INSTALLED); } // EOF: MOD - Separate Pricing Per Customer $include_modules = array(); if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) { $this->selected_module = $module; $include_modules[] = array('class' => $module, 'file' => $module . '.php'); } else { reset($this->modules); // BOF: MOD - Downloads Controller - Free Shipping and Payments // Show either normal payment modules or free payment module when Free Shipping Module is On // Free Payment Only if (tep_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') && ($cart->show_total() == 0 && $cart->show_weight() == 0)) { $this->selected_module = $module; $include_modules[] = array('class' => 'freecharger', 'file' => 'freecharger.php'); } else { // All Other Payment Modules while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); // Don't show Free Payment Module if ($class != 'freecharger') { $include_modules[] = array('class' => $class, 'file' => $value); } } // EOF: MOD - Downloads Controller } } for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) { include DIR_WS_LANGUAGES . $language . '/' . $include_modules[$i]['file']; include DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']; $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'](); } // if there is only one payment method, select it as default because in // checkout_confirmation.php the $payment variable is being assigned the // $_POST['payment'] value which will be empty (no radio button selection possible) if (tep_count_payment_modules() == 1 && (!isset($GLOBALS[$payment]) || isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) { $payment = $include_modules[0]['class']; } if (tep_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) { $this->form_action_url = $GLOBALS[$module]->form_action_url; } } }
case 'update_order': $oID = tep_db_prepare_input($_GET['oID']); $status = tep_db_prepare_input($_POST['status']); $comments = tep_db_prepare_input($_POST['comments']); $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'"); $check_status = tep_db_fetch_array($check_status_query); // BOF: MOD - Downloads Controller // always update date and time on order_status // original if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) { if ($check_status['orders_status'] != $status || $comments != '' || $status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) { tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int) $oID . "'"); $check_status_query2 = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'"); $check_status2 = tep_db_fetch_array($check_status_query2); if ($check_status2['orders_status'] == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) { tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_DAYS') . "', download_count = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_COUNT') . "' where orders_id = '" . (int) $oID . "'"); } // EOF: MOD - Downloads Controller // *** BEGIN GOOGLE CHECKOUT *** if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') { require_once DIR_FS_CATALOG . 'googlecheckout/inserts/admin/orders2.php'; } else { // *** END GOOGLE CHECKOUT *** $customer_notified = '0'; if (isset($_POST['notify']) && $_POST['notify'] == 'on') { $notify_comments = ''; if (isset($_POST['notify_comments']) && $_POST['notify_comments'] == 'on' && strlen($comments) > 0) { $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n"; } $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
<?php /* $Id$ osCmax e-Commerce http://www.oscmax.com Copyright 2000 - 2011 osCmax Released under the GNU General Public License */ include 'includes/application_top.php'; // BOF: Downloads Controller - Free Shipping // Reset $shipping if free shipping is on and weight is not 0 if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight() != 0) { tep_session_unregister('shipping'); } // EOF: Downloads Controller - Free Shipping /* One Page Checkout - BEGIN */ // if the customer is not logged on, redirect them to the login page // if (!tep_session_is_registered('customer_id')) { // $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); // tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); // } /* One Page Checkout - BEGIN */ if (ONEPAGE_LOGIN_REQUIRED == 'true') { if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); }
function shipping($module = '') { // LINE CHANGED: MOD - Downloads Controller - Added $cart global $language, $PHP_SELF, $cart; // LINE ADDED: MOD - Individual Shipping Prices 4.5 $shiptotal = $this->get_shiptotal(); if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) { // BOF: MOD - Separate Pricing Per Customer, next line original code // $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); global $sppc_customer_group_id, $customer_id; if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $customer_shipment_query = tep_db_query("select IF(c.customers_shipment_allowed <> '', c.customers_shipment_allowed, cg.group_shipment_allowed) as shipment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'"); if ($customer_shipment = tep_db_fetch_array($customer_shipment_query)) { if (tep_not_null($customer_shipment['shipment_allowed'])) { $temp_shipment_array = explode(';', $customer_shipment['shipment_allowed']); $installed_modules = explode(';', MODULE_SHIPPING_INSTALLED); for ($n = 0; $n < sizeof($installed_modules); $n++) { // check to see if a shipping module is not de-installed if (in_array($installed_modules[$n], $temp_shipment_array)) { $shipment_array[] = $installed_modules[$n]; } } // end for loop $this->modules = $shipment_array; } else { $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); } } else { // default $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); } // EOF: MOD - Separate Pricing Per Customer $include_modules = array(); if (tep_not_null($module) && in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) { $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1)); } else { reset($this->modules); // BOF: MOD - Downloads Controller - Free Shipping and Payments // Show either normal shipping modules or free shipping module when Free Shipping Module is On // Free Shipping Only if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight() == 0) { $include_modules[] = array('class' => 'freeshipper', 'file' => 'freeshipper.php'); } //BOF: MOD INDIVSHIP 4.5 if (tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS') and $shiptotal) { $include_modules[] = array('class' => 'indvship', 'file' => 'indvship.php'); } if (!$this->only_indv) { // All Other Shipping Modules while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); // Don't show Free Shipping Module if ($class != 'freeshipper') { if ($class != 'indvship') { $include_modules[] = array('class' => $class, 'file' => $value); } } } // EOF: MOD - Downloads Controller - Free Shipping and Payments // EOF: MOD INDIVSHIP 4.5 } } for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) { include DIR_WS_LANGUAGES . $language . '/' . $include_modules[$i]['file']; include DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']; $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'](); } } }