当前位置: 首页>>代码示例>>PHP>>正文


PHP Core\OSCOM类代码示例

本文整理汇总了PHP中osCommerce\OM\Core\OSCOM的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM类的具体用法?PHP OSCOM怎么用?PHP OSCOM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OSCOM类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 public function initialize()
 {
     if (Registry::exists('Product')) {
         $OSCOM_Database = Registry::get('Database');
         $OSCOM_Product = Registry::get('Product');
         $OSCOM_Language = Registry::get('Language');
         $OSCOM_Image = Registry::get('Image');
         $Qorders = $OSCOM_Database->query('select p.products_id, pd.products_name, pd.products_keyword, i.image from :table_orders_products opa, :table_orders_products opb, :table_orders o, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where opa.products_id = :products_id and opa.orders_id = opb.orders_id and opb.products_id != :products_id and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id group by p.products_id order by o.date_purchased desc limit :limit');
         $Qorders->bindInt(':default_flag', 1);
         $Qorders->bindInt(':products_id', $OSCOM_Product->getID());
         $Qorders->bindInt(':products_id', $OSCOM_Product->getID());
         $Qorders->bindInt(':language_id', $OSCOM_Language->getID());
         $Qorders->bindInt(':limit', MODULE_CONTENT_ALSO_PURCHASED_MAX_DISPLAY);
         if (MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE > 0) {
             $Qorders->setCache('also_purchased-' . $OSCOM_Product->getID(), MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE);
         }
         $Qorders->execute();
         if ($Qorders->numberOfRows() >= MODULE_CONTENT_ALSO_PURCHASED_MIN_DISPLAY) {
             $this->_content = '<div style="overflow: auto;">';
             while ($Qorders->next()) {
                 $this->_content .= '<span style="width: 33%; float: left; text-align: center;">';
                 if (strlen($Qorders->value('image')) > 0) {
                     $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', $Qorders->value('products_keyword')), $OSCOM_Image->show($Qorders->value('image'), $Qorders->value('products_name'))) . '<br />';
                 }
                 $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', $Qorders->value('products_keyword')), $Qorders->value('products_name')) . '</span>';
             }
             $this->_content .= '</div>';
         }
         $Qorders->freeResult();
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:31,代码来源:Controller.php

示例2: execute

 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'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:28,代码来源:Process.php

示例3: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_PaymentModule = Registry::get('PaymentModule');
     $OSCOM_PaymentModule->process();
     osc_redirect(OSCOM::getLink(null, null, 'Success', 'SSL'));
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:Process.php

示例4: __construct

 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;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:Total.php

示例5: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Shipping = Registry::get('Shipping');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if (!empty($_POST['comments'])) {
         $_SESSION['comments'] = HTML::sanitize($_POST['comments']);
     }
     if ($OSCOM_Shipping->hasQuotes()) {
         if (isset($_POST['shipping_mod_sel']) && strpos($_POST['shipping_mod_sel'], '_')) {
             list($module, $method) = explode('_', $_POST['shipping_mod_sel']);
             if (Registry::exists('Shipping_' . $module) && Registry::get('Shipping_' . $module)->isEnabled()) {
                 $quote = $OSCOM_Shipping->getQuote($_POST['shipping_mod_sel']);
                 if (isset($quote['error'])) {
                     $OSCOM_ShoppingCart->resetShippingMethod();
                 } else {
                     $OSCOM_ShoppingCart->setShippingMethod($quote);
                     OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
                 }
             } else {
                 $OSCOM_ShoppingCart->resetShippingMethod();
             }
         }
     } else {
         $OSCOM_ShoppingCart->resetShippingMethod();
         OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:27,代码来源:Process.php

示例6: initialize

 public function initialize()
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Image = Registry::get('Image');
     $this->_title_link = OSCOM::getLink(null, 'Products', 'Specials');
     if ($OSCOM_Service->isStarted('Specials')) {
         if (BOX_SPECIALS_CACHE > 0 && $OSCOM_Cache->read('box-specials-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), BOX_SPECIALS_CACHE)) {
             $data = $OSCOM_Cache->getCache();
         } else {
             $Qspecials = $OSCOM_PDO->prepare('select p.products_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_specials s where s.status = 1 and s.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by s.specials_date_added desc limit :max_random_select_specials');
             $Qspecials->bindInt(':default_flag', 1);
             $Qspecials->bindInt(':language_id', $OSCOM_Language->getID());
             $Qspecials->bindInt(':max_random_select_specials', BOX_SPECIALS_RANDOM_SELECT);
             $Qspecials->execute();
             $data = $Qspecials->fetchAll();
             if (count($data) > 0) {
                 $data = $result[rand(0, count($result) - 1)];
                 $data['products_price'] = '<s>' . $OSCOM_Currencies->displayPrice($data['products_price'], $data['products_tax_class_id']) . '</s>&nbsp;<span class="productSpecialPrice">' . $OSCOM_Currencies->displayPrice($data['specials_new_products_price'], $data['products_tax_class_id']) . '</span>';
                 $OSCOM_Cache->write($data);
             }
         }
         if (!empty($data)) {
             $this->_content = '';
             if (!empty($data['image'])) {
                 $this->_content = HTML::link(OSCOM::getLink(null, 'Products', $data['products_keyword']), $OSCOM_Image->show($data['image'], $data['products_name'])) . '<br />';
             }
             $this->_content .= HTML::link(OSCOM::getLink(null, 'Products', $data['products_keyword']), $data['products_name']) . '<br />' . $data['products_price'];
         }
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:34,代码来源:Controller.php

示例7: initialize

 /**
  * 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;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:12,代码来源:PayPalExpressCheckout.php

示例8: initialize

 /**
  * 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;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:12,代码来源:COD.php

示例9: __construct

    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');
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:7,代码来源:ProductAttributeModuleAbstract.php

示例10: execute

 public static function execute($module)
 {
     $class = 'osCommerce\\OM\\Core\\Site\\Admin\\Module\\Service\\' . $module;
     if (class_exists($class)) {
         $OSCOM_SM = new $class();
         $OSCOM_SM->install();
         $sm = explode(';', MODULE_SERVICES_INSTALLED);
         if (isset($OSCOM_SM->depends)) {
             if (is_string($OSCOM_SM->depends) && ($key = array_search($OSCOM_SM->depends, $sm)) !== false) {
                 if (isset($sm[$key + 1])) {
                     array_splice($sm, $key + 1, 0, $module);
                 } else {
                     $sm[] = $module;
                 }
             } elseif (is_array($OSCOM_SM->depends)) {
                 foreach ($OSCOM_SM->depends as $depends_module) {
                     if (($key = array_search($depends_module, $sm)) !== false) {
                         if (!isset($array_position) || $key > $array_position) {
                             $array_position = $key;
                         }
                     }
                 }
                 if (isset($array_position)) {
                     array_splice($sm, $array_position + 1, 0, $module);
                 } else {
                     $sm[] = $module;
                 }
             }
         } elseif (isset($OSCOM_SM->precedes)) {
             if (is_string($OSCOM_SM->precedes)) {
                 if (($key = array_search($OSCOM_SM->precedes, $sm)) !== false) {
                     array_splice($sm, $key, 0, $module);
                 } else {
                     $sm[] = $module;
                 }
             } elseif (is_array($OSCOM_SM->precedes)) {
                 foreach ($OSCOM_SM->precedes as $precedes_module) {
                     if (($key = array_search($precedes_module, $sm)) !== false) {
                         if (!isset($array_position) || $key < $array_position) {
                             $array_position = $key;
                         }
                     }
                 }
                 if (isset($array_position)) {
                     array_splice($sm, $array_position, 0, $module);
                 } else {
                     $sm[] = $module;
                 }
             }
         } else {
             $sm[] = $module;
         }
         $data = array('key' => 'MODULE_SERVICES_INSTALLED', 'value' => implode(';', $sm));
         if (OSCOM::callDB('Admin\\Configuration\\EntrySave', $data)) {
             Cache::clear('configuration');
             return true;
         }
     }
     return false;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:60,代码来源:install.php

示例11: getIcon

 public function getIcon($size = 16, $icon = null, $title = null)
 {
     if (!isset($icon)) {
         $icon = $this->_application->getIcon();
     }
     return HTML::image(OSCOM::getPublicSiteLink('images/applications/' . $size . '/' . $icon), $title, $size, $size);
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:7,代码来源:Template.php

示例12: osc_cfg_set_boolean_value

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;
}
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:31,代码来源:osc_cfg_set_boolean_value.php

示例13: execute

 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;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:29,代码来源:getJSList.php

示例14: getIcon

 public function getIcon($size = 16, $icon = null, $title = null)
 {
     if (empty($icon)) {
         $icon = $this->_application->getIcon();
     }
     return '<img src="' . OSCOM::getPublicSiteLink('images/applications/' . (int) $size . '/' . $icon) . '" border="0" alt="" title="' . osc_output_string_protected($title) . '" width="' . (int) $size . '" height="' . (int) $size . '" />';
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:Template.php

示例15: initialize

 public function initialize()
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     if ($OSCOM_Customer->isLoggedOn()) {
         $Qorders = $OSCOM_Database->query('select distinct op.products_id from :table_orders o, :table_orders_products op, :table_products p where o.customers_id = :customers_id and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = 1 group by products_id order by o.date_purchased desc limit :limit');
         $Qorders->bindInt(':customers_id', $OSCOM_Customer->getID());
         $Qorders->bindInt(':limit', BOX_ORDER_HISTORY_MAX_LIST);
         $Qorders->execute();
         if ($Qorders->numberOfRows()) {
             $product_ids = '';
             while ($Qorders->next()) {
                 $product_ids .= $Qorders->valueInt('products_id') . ',';
             }
             $product_ids = substr($product_ids, 0, -1);
             $Qproducts = $OSCOM_Database->query('select products_id, products_name, products_keyword from :table_products_description where products_id in (:products_id) and language_id = :language_id order by products_name');
             $Qproducts->bindRaw(':products_id', $product_ids);
             $Qproducts->bindInt(':language_id', $OSCOM_Language->getID());
             $Qproducts->execute();
             $this->_content = '<ol style="list-style: none; margin: 0; padding: 0;">';
             while ($Qproducts->next()) {
                 $this->_content .= '<li>' . osc_link_object(OSCOM::getLink(null, 'Products', $Qproducts->value('products_keyword')), $Qproducts->value('products_name')) . '</li>';
             }
             $this->_content .= '</ol>';
         }
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:28,代码来源:Controller.php


注:本文中的osCommerce\OM\Core\OSCOM类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。