public function __construct() { $OSCOM_Language = Registry::get('Language'); $OSCOM_Language->loadIniFile('modules/services/language.php'); $this->title = OSCOM::getDef('services_language_title'); $this->description = OSCOM::getDef('services_language_description'); }
public static function start() { $OSCOM_Language = Registry::get('Language'); $OSCOM_MessageStack = Registry::get('MessageStack'); if (SERVICE_DEBUG_CHECK_LOCALE == '1') { $setlocale = setlocale(LC_TIME, explode(',', $OSCOM_Language->getLocale())); if ($setlocale === false || $setlocale === null) { $OSCOM_MessageStack->add('debug', 'Error: Locale does not exist: ' . $OSCOM_Language->getLocale(), 'error'); } } if (SERVICE_DEBUG_CHECK_INSTALLATION_MODULE == '1' && file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/Setup')) { $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_install_directory_exists'), OSCOM::BASE_DIRECTORY . 'Core/Site/Setup'), 'warning'); } if (SERVICE_DEBUG_CHECK_CONFIGURATION == '1' && is_writeable(OSCOM::BASE_DIRECTORY . 'Config/settings.ini')) { $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_config_file_writeable'), OSCOM::BASE_DIRECTORY . 'Config//settings.ini'), 'warning'); } if (SERVICE_DEBUG_CHECK_SESSION_DIRECTORY == '1' && OSCOM::getConfig('store_sessions') == '') { if (!is_dir(OSCOM_Registry::get('Session')->getSavePath())) { $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_session_directory_non_existent'), OSCOM_Registry::get('Session')->getSavePath()), 'warning'); } elseif (!is_writeable(OSCOM_Registry::get('Session')->getSavePath())) { $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_session_directory_not_writeable'), OSCOM_Registry::get('Session')->getSavePath()), 'warning'); } } if (SERVICE_DEBUG_CHECK_SESSION_AUTOSTART == '1' && (bool) ini_get('session.auto_start')) { $OSCOM_MessageStack->add('debug', OSCOM::getDef('warning_session_auto_start'), 'warning'); } if (SERVICE_DEBUG_CHECK_DOWNLOAD_DIRECTORY == '1' && DOWNLOAD_ENABLED == '1') { if (!is_dir(DIR_FS_DOWNLOAD)) { $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_download_directory_non_existent'), DIR_FS_DOWNLOAD), 'warning'); } } return true; }
public static function execute(ApplicationAbstract $application) { $OSCOM_Customer = Registry::get('Customer'); $OSCOM_NavigationHistory = Registry::get('NavigationHistory'); $OSCOM_Language = Registry::get('Language'); $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); if ($OSCOM_Customer->isLoggedOn() === false) { $OSCOM_NavigationHistory->setSnapshot(); osc_redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL')); } $application->setPageTitle(OSCOM::getDef('orders_heading')); $application->setPageContent('orders.php'); $OSCOM_Language->load('order'); if ($OSCOM_Service->isStarted('Breadcrumb')) { $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_my_orders'), OSCOM::getLink(null, null, 'Orders', 'SSL')); if (is_numeric($_GET['Orders'])) { $OSCOM_Breadcrumb->add(sprintf(OSCOM::getDef('breadcrumb_order_information'), $_GET['Orders']), OSCOM::getLink(null, null, 'Orders=' . $_GET['Orders'], 'SSL')); } } if (is_numeric($_GET['Orders'])) { if (Order::getCustomerID($_GET['Orders']) !== $OSCOM_Customer->getID()) { osc_redirect(OSCOM::getLink(null, null, null, 'SSL')); } $application->setPageTitle(sprintf(OSCOM::getDef('order_information_heading'), $_GET['Orders'])); $application->setPageContent('orders_info.php'); } }
public static function execute(ApplicationAbstract $application) { $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); $application->setPageTitle(sprintf(OSCOM::getDef('index_heading'), STORE_NAME)); $application->setPageContent('product_listing.php'); if (is_numeric($_GET['Manufacturers'])) { Registry::set('Manufacturer', new Manufacturer($_GET['Manufacturers'])); $OSCOM_Manufacturer = Registry::get('Manufacturer'); $application->setPageTitle($OSCOM_Manufacturer->getTitle()); // HPDL $application->setPageImage('manufacturers/' . $OSCOM_Manufacturer->getImage()); if ($OSCOM_Service->isStarted('Breadcrumb')) { $OSCOM_Breadcrumb->add($OSCOM_Manufacturer->getTitle(), OSCOM::getLink()); } Registry::set('Products', new Products()); $OSCOM_Products = Registry::get('Products'); $OSCOM_Products->setManufacturer($OSCOM_Manufacturer->getID()); if (isset($_GET['filter']) && is_numeric($_GET['filter']) && $_GET['filter'] > 0) { $OSCOM_Products->setCategory($_GET['filter']); } if (isset($_GET['sort']) && !empty($_GET['sort'])) { if (strpos($_GET['sort'], '|d') !== false) { $OSCOM_Products->setSortBy(substr($_GET['sort'], 0, -2), '-'); } else { $OSCOM_Products->setSortBy($_GET['sort']); } } } else { osc_redirect(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication())); } }
/** * Initialize module * * @access protected */ protected function initialize() { $this->_title = OSCOM::getDef('payment_cod_title'); $this->_description = OSCOM::getDef('payment_cod_description'); $this->_status = defined('MODULE_PAYMENT_COD_STATUS') && MODULE_PAYMENT_COD_STATUS == '1' ? true : false; $this->_sort_order = defined('MODULE_PAYMENT_COD_SORT_ORDER') ? MODULE_PAYMENT_COD_SORT_ORDER : 0; }
public function getTaxRateDescription($class_id, $country_id, $zone_id) { $OSCOM_PDO = Registry::get('PDO'); if ( !isset($this->tax_rates[$class_id][$country_id][$zone_id]['description']) ) { $Qtax = $OSCOM_PDO->prepare('select tax_description from :table_tax_rates tr left join :table_zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join :table_geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = 0 or za.zone_country_id = :zone_country_id) and (za.zone_id is null or za.zone_id = 0 or za.zone_id = :zone_id) and tr.tax_class_id = :tax_class_id group by tr.tax_priority'); $Qtax->bindInt(':zone_country_id', $country_id); $Qtax->bindInt(':zone_id', $zone_id); $Qtax->bindInt(':tax_class_id', $class_id); $Qtax->execute(); $tax_rates = $Qtax->fetchAll(); if ( count($tax_rates) > 0 ) { $tax_description = ''; foreach ( $tax_rates as $tr ) { $tax_description .= $tr['tax_description'] . ' + '; } $this->tax_rates[$class_id][$country_id][$zone_id]['description'] = substr($tax_description, 0, -3); } else { $this->tax_rates[$class_id][$country_id][$zone_id]['description'] = OSCOM::getDef('tax_rate_unknown'); } } return $this->tax_rates[$class_id][$country_id][$zone_id]['description']; }
protected function initialize() { $OSCOM_PDO = Registry::get('PDO'); $OSCOM_ShoppingCart = Registry::get('ShoppingCart'); $this->_api_version = '60.0'; $this->_title = OSCOM::getDef('paypal_express_checkout_title'); $this->_method_title = OSCOM::getDef('paypal_express_checkout_method_title'); $this->_status = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_STATUS == '1' ? true : false; $this->_sort_order = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_SORT_ORDER; if ($this->_status === true) { if ((int) MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ORDER_STATUS_ID; } if ((int) MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ZONE > 0) { $check_flag = false; $Qcheck = $OSCOM_PDO->prepare('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id'); $Qcheck->bindInt(':geo_zone_id', MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ZONE); $Qcheck->bindInt(':zone_country_id', $OSCOM_ShoppingCart->getBillingAddress('country_id')); $Qcheck->execute(); while ($Qcheck->fetch()) { if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; } elseif ($Qcheck->valueInt('zone_id') == $OSCOM_ShoppingCart->getBillingAddress('zone_id')) { $check_flag = true; break; } } if ($check_flag === false) { $this->_status = false; } } } }
public function initialize() { $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null; $OSCOM_PDO = Registry::get('PDO'); $OSCOM_Language = Registry::get('Language'); if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) { $Qmanufacturer = $OSCOM_PDO->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id'); $Qmanufacturer->bindInt(':languages_id', $OSCOM_Language->getID()); $Qmanufacturer->bindInt(':products_id', $OSCOM_Product->getID()); $Qmanufacturer->execute(); $result = $Qmanufacturer->fetch(); if (!empty($result)) { $this->_content = ''; if (strlen($result['manufacturers_image']) > 0) { $this->_content .= '<div style="text-align: center;">' . HTML::link(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $result['manufacturers_id']), HTML::image('public/manufacturers/' . $result['manufacturers_image'], $result['manufacturers_name'])) . '</div>'; } $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">'; if (strlen($result['manufacturers_url']) > 0) { $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Redirct', 'Manufacturer=' . $result['manufacturers_id']), sprintf(OSCOM::getDef('box_manufacturer_info_website'), $result['manufacturers_name']), 'target="_blank"') . '</li>'; } $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $result['manufacturers_id']), OSCOM::getDef('box_manufacturer_info_products')) . '</li>'; $this->_content .= '</ol>'; } } }
function osc_cfg_set_boolean_value($select_array, $default, $key = null) { $string = ''; $select_array = explode(',', substr($select_array, 6, -1)); $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value'; for ($i = 0, $n = count($select_array); $i < $n; $i++) { $value = trim($select_array[$i]); if (strpos($value, '\'') !== false) { $value = substr($value, 1, -1); } else { $value = (int) $value; } $select_array[$i] = $value; if ($value === -1) { $value = OSCOM::getDef('parameter_false'); } elseif ($value === 0) { $value = OSCOM::getDef('parameter_optional'); } elseif ($value === 1) { $value = OSCOM::getDef('parameter_true'); } $string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"'; if ($default == $select_array[$i]) { $string .= ' checked="checked"'; } $string .= '> ' . $value . '<br />'; } if (!empty($string)) { $string = substr($string, 0, -6); } return $string; }
public function __construct() { $OSCOM_Language = Registry::get('Language'); $OSCOM_Language->loadIniFile('modules/ProductAttribute/' . $this->getCode() . '.php'); $this->_title = OSCOM::getDef('product_attribute_' . $this->getCode() . '_title'); }
public static function execute(ApplicationAbstract $application) { $OSCOM_Database = Registry::get('Database'); $OSCOM_Customer = Registry::get('Customer'); $OSCOM_MessageStack = Registry::get('MessageStack'); if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) { $newsletter_general = (int) $_POST['newsletter_general']; } else { $newsletter_general = 0; } // HPDL Should be moved to the customers class! $Qnewsletter = $OSCOM_Database->query('select customers_newsletter from :table_customers where customers_id = :customers_id'); $Qnewsletter->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qnewsletter->execute(); if ($newsletter_general !== $Qnewsletter->valueInt('customers_newsletter')) { $newsletter_general = $Qnewsletter->value('customers_newsletter') == '1' ? '0' : '1'; $Qupdate = $OSCOM_Database->query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id'); $Qupdate->bindInt(':customers_newsletter', $newsletter_general); $Qupdate->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qupdate->execute(); if ($Qupdate->affectedRows() === 1) { $OSCOM_MessageStack->add('Account', OSCOM::getDef('success_newsletter_updated'), 'success'); } } osc_redirect(OSCOM::getLink(null, null, null, 'SSL')); }
public static function execute($country, $form, $field) { $OSCOM_PDO = Registry::get('PDO'); $num_country = 1; $output_string = ''; $Qcountries = $OSCOM_PDO->query('select distinct zone_country_id from :table_zones order by zone_country_id'); $Qcountries->execute(); while ($Qcountries->fetch()) { if ($num_country == 1) { $output_string .= ' if (' . $country . ' == "' . $Qcountries->valueInt('zone_country_id') . '") {' . "\n"; } else { $output_string .= ' } else if (' . $country . ' == "' . $Qcountries->valueInt('zone_country_id') . '") {' . "\n"; } $num_state = 1; $Qzones = $OSCOM_PDO->prepare('select zone_name, zone_id from :table_zones where zone_country_id = :zone_country_id order by zone_name'); $Qzones->bindInt(':zone_country_id', $Qcountries->valueInt('zone_country_id')); $Qzones->execute(); while ($Qzones->fetch()) { if ($num_state == '1') { $output_string .= ' ' . $form . '.' . $field . '.options[0] = new Option("' . OSCOM::getDef('all_zones') . '", "");' . "\n"; } $output_string .= ' ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $Qzones->value('zone_name') . '", "' . $Qzones->valueInt('zone_id') . '");' . "\n"; $num_state++; } $num_country++; } $output_string .= ' } else {' . "\n" . ' ' . $form . '.' . $field . '.options[0] = new Option("' . OSCOM::getDef('all_zones') . '", "");' . "\n" . ' }' . "\n"; return $output_string; }
public function __construct() { Registry::get('Language')->loadIniFile('modules/Dashboard/Customers.php'); $this->_title = OSCOM::getDef('admin_indexmodules_customers_title'); $this->_title_link = OSCOM::getLink(null, 'Customers'); if (Access::hasAccess(OSCOM::getSite(), 'Customers')) { $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_customers') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>'; $Qcustomers = Registry::get('Database')->query('select customers_id, customers_gender, customers_lastname, customers_firstname, customers_status, date_account_created from :table_customers order by date_account_created desc limit 6'); $Qcustomers->execute(); $counter = 0; while ($Qcustomers->next()) { $customer_icon = osc_icon('people.png'); if (ACCOUNT_GENDER > -1) { switch ($Qcustomers->value('customers_gender')) { case 'm': $customer_icon = osc_icon('user_male.png'); break; case 'f': $customer_icon = osc_icon('user_female.png'); break; } } $this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'Customers', 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . ' ' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname')) . '</td>' . ' <td>' . $Qcustomers->value('date_account_created') . '</td>' . ' <td align="center">' . osc_icon($Qcustomers->valueInt('customers_status') === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . ' </tr>'; $counter++; } $this->_data .= ' </tbody>' . '</table>'; } }
public static function execute(ApplicationAbstract $application) { $OSCOM_PDO = Registry::get('PDO'); $OSCOM_MessageStack = Registry::get('MessageStack'); $Qcheck = $OSCOM_PDO->prepare('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindValue(':customers_email_address', $_POST['email_address']); $Qcheck->execute(); if ($Qcheck->fetch() !== false) { $password = Hash::getRandomString(ACCOUNT_PASSWORD); if (Account::savePassword($password, $Qcheck->valueInt('customers_id'))) { if (ACCOUNT_GENDER > -1) { if ($Qcheck->value('customers_gender') == 'm') { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } else { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } } else { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } $email_text .= sprintf(OSCOM::getDef('email_password_reminder_body'), OSCOM::getIPAddress(), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS); $pEmail = new Mail($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, sprintf(OSCOM::getDef('email_password_reminder_subject'), STORE_NAME)); $pEmail->setBodyPlain($email_text); $pEmail->send(); $OSCOM_MessageStack->add('LogIn', OSCOM::getDef('success_password_forgotten_sent'), 'success'); } OSCOM::redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL')); } else { $OSCOM_MessageStack->add('PasswordForgotten', OSCOM::getDef('error_password_forgotten_no_email_address_found')); } }
public function initialize() { $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null; $OSCOM_Customer = Registry::get('Customer'); $OSCOM_Database = Registry::get('Database'); $OSCOM_Language = Registry::get('Language'); $this->_title_link = OSCOM::getLink(null, 'Account', 'Notifications', 'SSL'); if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) { if ($OSCOM_Customer->isLoggedOn()) { $Qcheck = $OSCOM_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id'); $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qcheck->execute(); if ($Qcheck->valueInt('global_product_notifications') === 0) { $Qcheck = $OSCOM_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1'); $Qcheck->bindInt(':products_id', $OSCOM_Product->getID()); $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qcheck->execute(); if ($Qcheck->numberOfRows() > 0) { $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle())); } else { $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle())); } $this->_content .= '<div style="clear: both;"></div>'; } } } }
public static function execute(ApplicationAbstract $application) { $OSCOM_ShoppingCart = Registry::get('ShoppingCart'); $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); $OSCOM_Template = Registry::get('Template'); global $osC_oiAddress; // HPDL $application->setPageTitle(OSCOM::getDef('payment_method_heading')); $application->setPageContent('billing.php'); if ($OSCOM_Service->isStarted('Breadcrumb')) { $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_payment'), OSCOM::getLink(null, null, 'Billing', 'SSL')); } // load billing address page if no default address exists if (!$OSCOM_ShoppingCart->hasBillingAddress()) { $application->setPageTitle(OSCOM::getDef('payment_address_heading')); $application->setPageContent('billing_address.php'); $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_payment_address.js')); $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php'); if (!$OSCOM_Customer->isLoggedOn()) { $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getBillingAddress()); } } else { $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_payment.js')); // load all enabled payment modules $OSCOM_Payment = Registry::get('Payment'); $OSCOM_Payment->loadAll(); $OSCOM_Template->addJavascriptBlock($OSCOM_Payment->getJavascriptBlocks()); } // HPDL // if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) { // $OSCOM_MessageStack->add('CheckoutBilling', $error['error'], 'error'); // } }
public function initialize() { $OSCOM_ShoppingCart = Registry::get('ShoppingCart'); $OSCOM_Template = Registry::get('Template'); $steps = array(); if ($OSCOM_ShoppingCart->getContentType() != 'virtual') { $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_delivery'), 'code' => 'shipping', 'active' => $OSCOM_Template->getModule() == 'Shipping' || $OSCOM_Template->getModule() == 'ShippingAddress' ? true : false); } $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_payment'), 'code' => 'payment', 'active' => $OSCOM_Template->getModule() == 'Payment' || $OSCOM_Template->getModule() == 'PaymentAddress' ? true : false); $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_confirmation'), 'code' => 'confirmation', 'active' => $OSCOM_Template->getModule() == 'Confirmation' ? true : false); $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_complete'), 'active' => $OSCOM_Template->getModule() == 'Success' ? true : false); $content = osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/32x32/checkout_preparing_to_ship.gif') . '<br />'; $counter = 0; foreach ($steps as $step) { $counter++; $content .= '<span style="white-space: nowrap;"> ' . osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/24x24/checkout_' . $counter . ($step['active'] === true ? '_on' : '') . '.gif', $step['title'], 24, 24, 'align="absmiddle"'); if (isset($step['code'])) { $content .= osc_link_object(OSCOM::getLink(null, 'Checkout', $step['code'], 'SSL'), $step['title'], 'class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '"'); } else { $content .= '<span class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '">' . $step['title'] . '</span>'; } $content .= '</span><br />'; } $content .= osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/32x32/checkout_ready_to_ship.gif'); $this->_content = $content; }
protected function initialize() { $OSCOM_Database = Registry::get('Database'); $OSCOM_ShoppingCart = Registry::get('ShoppingCart'); $this->_title = OSCOM::getDef('payment_cod_title'); $this->_method_title = OSCOM::getDef('payment_cod_method_title'); $this->_status = MODULE_PAYMENT_COD_STATUS == '1' ? true : false; $this->_sort_order = MODULE_PAYMENT_COD_SORT_ORDER; if ($this->_status === true) { if ((int) MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID; } if ((int) MODULE_PAYMENT_COD_ZONE > 0) { $check_flag = false; $Qcheck = $OSCOM_Database->query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id'); $Qcheck->bindInt(':geo_zone_id', MODULE_PAYMENT_COD_ZONE); $Qcheck->bindInt(':zone_country_id', $OSCOM_ShoppingCart->getBillingAddress('country_id')); $Qcheck->execute(); while ($Qcheck->next()) { if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; } elseif ($Qcheck->valueInt('zone_id') == $OSCOM_ShoppingCart->getBillingAddress('zone_id')) { $check_flag = true; break; } } if ($check_flag === false) { $this->_status = false; } } } }
public static function execute(ApplicationAbstract $application) { $OSCOM_Database = Registry::get('Database'); $OSCOM_MessageStack = Registry::get('MessageStack'); $Qcheck = $OSCOM_Database->query('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindValue(':customers_email_address', $_POST['email_address']); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 1) { $password = osc_create_random_string(ACCOUNT_PASSWORD); if (Account::savePassword($password, $Qcheck->valueInt('customers_id'))) { if (ACCOUNT_GENDER > -1) { if ($Qcheck->value('customers_gender') == 'm') { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } else { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } } else { $email_text = sprintf(OSCOM::getDef('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } $email_text .= sprintf(OSCOM::getDef('email_password_reminder_body'), osc_get_ip_address(), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS); osc_email($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), sprintf(OSCOM::getDef('email_password_reminder_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $OSCOM_MessageStack->add('LogIn', OSCOM::getDef('success_password_forgotten_sent'), 'success'); } osc_redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL')); } else { $OSCOM_MessageStack->add('PasswordForgotten', OSCOM::getDef('error_password_forgotten_no_email_address_found')); } }
public function __construct() { $this->_title = OSCOM::getDef('order_total_total_title'); $this->_description = OSCOM::getDef('order_total_total_description'); $this->_status = defined('MODULE_ORDER_TOTAL_TOTAL_STATUS') && MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true' ? true : false; $this->_sort_order = defined('MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER') ? MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER : null; }
public static function execute(ApplicationAbstract $application) { $OSCOM_MessageStack = Registry::get('MessageStack'); $data = array(); if (DISPLAY_PRIVACY_CONDITIONS == '1') { if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') { $OSCOM_MessageStack->add('Create', OSCOM::getDef('error_privacy_statement_not_accepted')); } } if (ACCOUNT_GENDER >= 0) { if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) { $data['gender'] = $_POST['gender']; } else { $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_gender_error')); } } if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) { $data['firstname'] = $_POST['firstname']; } else { $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_first_name_error'), ACCOUNT_FIRST_NAME)); } if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) { $data['lastname'] = $_POST['lastname']; } else { $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_last_name_error'), ACCOUNT_LAST_NAME)); } if (ACCOUNT_DATE_OF_BIRTH == '1') { if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) { $data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']); } else { $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_date_of_birth_error')); } } if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) { if (filter_var($_POST['email_address'], FILTER_VALIDATE_EMAIL)) { if (Account::checkEntry($_POST['email_address']) === false) { $data['email_address'] = $_POST['email_address']; } else { $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_exists_error')); } } else { $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_check_error')); } } else { $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS)); } if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) { $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_password_error'), ACCOUNT_PASSWORD)); } elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) { $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_password_mismatch_with_confirmation')); } else { $data['password'] = $_POST['password']; } if ($OSCOM_MessageStack->size('Create') === 0) { if (Account::createEntry($data)) { $OSCOM_MessageStack->add('Create', OSCOM::getDef('success_account_updated'), 'success'); } OSCOM::redirect(OSCOM::getLink(null, null, 'Create&Success', 'SSL')); } }
/** * Initialize module * * @access protected */ protected function initialize() { $this->_title = OSCOM::getDef('paypal_express_checkout_title'); $this->_description = OSCOM::getDef('paypal_express_checkout_description'); $this->_status = defined('MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_STATUS') && MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_STATUS == '1' ? true : false; $this->_sort_order = defined('MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_SORT_ORDER : 0; }
public static function execute(ApplicationAbstract $application) { $OSCOM_ShoppingCart = Registry::get('ShoppingCart'); $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); $OSCOM_Template = Registry::get('Template'); $OSCOM_Customer = Registry::get('Customer'); global $osC_oiAddress; // HPDL $application->setPageTitle(OSCOM::getDef('shipping_method_heading')); $application->setPageContent('shipping.php'); if ($OSCOM_Service->isStarted('Breadcrumb')) { $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_shipping'), OSCOM::getLink(null, null, 'Shipping', 'SSL')); } // load shipping address page if no default address exists if (!$OSCOM_ShoppingCart->hasShippingAddress()) { $application->setPageTitle(OSCOM::getDef('shipping_address_heading')); $application->setPageContent('shipping_address.php'); $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping_address.js')); $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php'); if (!$OSCOM_Customer->isLoggedOn()) { $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getShippingAddress()); } } else { $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping.js')); // load all enabled shipping modules Registry::set('Shipping', new ShippingClass(), true); } }
public static function execute(ApplicationAbstract $application) { $OSCOM_Customer = Registry::get('Customer'); $OSCOM_NavigationHistory = Registry::get('NavigationHistory'); $OSCOM_MessageStack = Registry::get('MessageStack'); $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) { $OSCOM_NavigationHistory->setSnapshot(); osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL')); } $requested_product = null; $product_check = false; if (count($_GET) > 3) { $requested_product = basename(key(array_slice($_GET, 3, 1, true))); if ($requested_product == 'Write') { unset($requested_product); if (count($_GET) > 4) { $requested_product = basename(key(array_slice($_GET, 4, 1, true))); } } } if (isset($requested_product)) { if (Product::checkEntry($requested_product)) { $product_check = true; } } if ($product_check === false) { $application->setPageContent('not_found.php'); return false; } Registry::set('Product', new Product($requested_product)); $OSCOM_Product = Registry::get('Product'); if (empty($_POST['from_name'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty')); } if (!osc_validate_email_address($_POST['from_email_address'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address')); } if (empty($_POST['to_name'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty')); } if (!osc_validate_email_address($_POST['to_email_address'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address')); } if ($OSCOM_MessageStack->size('TellAFriend') < 1) { $email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME); $email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n"; if (!empty($_POST['message'])) { $email_body .= osc_sanitize_string($_POST['message']) . "\n\n"; } $email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address'])); $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success'); osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword())); } $application->setPageTitle($OSCOM_Product->getTitle()); $application->setPageContent('tell_a_friend.php'); }
public function initialize() { $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null; if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) { // HPDL && ($osC_Template->getModule() != 'tell_a_friend')) { $this->_content = '<form name="tell_a_friend" action="' . OSCOM::getLink(null, null, 'TellAFriend&' . $OSCOM_Product->getKeyword()) . '" method="post">' . "\n" . HTML::inputField('to_email_address', null, 'style="width: 80%;"') . ' ' . HTML::submitImage('button_tell_a_friend.gif', OSCOM::getDef('box_tell_a_friend_text')) . '<br />' . OSCOM::getDef('box_tell_a_friend_text') . "\n" . '</form>' . "\n"; } }
public static function execute(ApplicationAbstract $application) { $OSCOM_MessageStack = Registry::get('MessageStack'); if (AddressBook::deleteEntry($_GET['Delete'])) { $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('success_address_book_entry_deleted'), 'success'); } OSCOM::redirect(OSCOM::getLink(null, null, 'AddressBook', 'SSL')); }
public function __construct() { $this->icon = ''; $this->_title = OSCOM::getDef('shipping_flat_title'); $this->_description = OSCOM::getDef('shipping_flat_description'); $this->_status = defined('MODULE_SHIPPING_FLAT_STATUS') && MODULE_SHIPPING_FLAT_STATUS == 'True' ? true : false; $this->_sort_order = defined('MODULE_SHIPPING_FLAT_SORT_ORDER') ? MODULE_SHIPPING_FLAT_SORT_ORDER : null; }
protected function process() { $this->_page_title = OSCOM::getDef('heading_title'); if (isset($_GET['id']) && is_numeric($_GET['id'])) { $this->_page_contents = 'entries.php'; $this->_page_title .= ': ' . ZoneGroups::get($_GET['id'], 'geo_zone_name'); } }
public static function start() { Registry::set('Breadcrumb', new BreadcrumbClass()); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_top'), OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication())); $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_shop'), OSCOM::getLink('Shop', 'Index')); return true; }
public function quote() { $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => OSCOM::getDef('shipping_flat_method'), 'cost' => MODULE_SHIPPING_FLAT_COST)), 'tax_class_id' => $this->tax_class); if (!empty($this->icon)) { $this->quotes['icon'] = osc_image($this->icon, $this->_title); } return $this->quotes; }