Beispiel #1
0
 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>';
             }
         }
     }
 }
Beispiel #2
0
 /**
  * Adds an entry to the breadcrumb navigation path
  *
  * @param string $title The title of the breadcrumb navigation entry
  * @param string $link The link of the breadcrumb navigation entry
  * @access public
  */
 public function add($title, $link = null)
 {
     if (!empty($link)) {
         $title = osc_link_object($link, $title);
     }
     $this->_path[] = $title;
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product, $osC_Customer;
     $this->_title_link = osc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL');
     if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
         if ($osC_Customer->isLoggedOn()) {
             $Qcheck = $osC_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
             $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
             $Qcheck->bindInt(':customers_id', $osC_Customer->getID());
             $Qcheck->execute();
             if ($Qcheck->valueInt('global_product_notifications') === 0) {
                 $Qcheck = $osC_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
                 $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
                 $Qcheck->bindInt(':products_id', $osC_Product->getID());
                 $Qcheck->bindInt(':customers_id', $osC_Customer->getID());
                 $Qcheck->execute();
                 if ($Qcheck->numberOfRows() > 0) {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()));
                 } else {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()));
                 }
                 $this->_content .= '<div style="clear: both;"></div>';
             }
         } else {
             $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle())) . '<div style="clear: both;"></div>';
         }
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product, $osC_Image;
     if (isset($osC_Product)) {
         $Qorders = $osC_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->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qorders->bindTable(':table_orders', TABLE_ORDERS);
         $Qorders->bindTable(':table_products', TABLE_PRODUCTS);
         $Qorders->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qorders->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qorders->bindInt(':default_flag', 1);
         $Qorders->bindInt(':products_id', $osC_Product->getID());
         $Qorders->bindInt(':products_id', $osC_Product->getID());
         $Qorders->bindInt(':language_id', $osC_Language->getID());
         $Qorders->bindInt(':limit', MODULE_CONTENT_ALSO_PURCHASED_MAX_DISPLAY);
         if (MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE > 0) {
             $Qorders->setCache('also_purchased-' . $osC_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 (osc_empty($Qorders->value('image')) === false) {
                     $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $osC_Image->show($Qorders->value('image'), $Qorders->value('products_name'))) . '<br />';
                 }
                 $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $Qorders->value('products_name')) . '</span>';
             }
             $this->_content .= '</div>';
         }
         $Qorders->freeResult();
     }
 }
Beispiel #5
0
 function initialize()
 {
     global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
     $data = array();
     if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         $Qnew = $osC_Database->query('select products_id from :table_products where products_status = :products_status order by products_date_added desc limit :max_random_select_new');
         $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
         $Qnew->bindInt(':products_status', 1);
         $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
         $Qnew->executeRandomMulti();
         if ($Qnew->numberOfRows()) {
             $osC_Product = new osC_Product($Qnew->valueInt('products_id'));
             $data = $osC_Product->getData();
             $data['display_price'] = $osC_Product->getPriceFormated(true);
             $data['display_image'] = $osC_Product->getImage();
         }
         $osC_Cache->write($data);
     }
     if (!empty($data)) {
         $this->_content = '';
         if (!empty($data['display_image'])) {
             $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $osC_Image->show($data['display_image'], $data['name'])) . '<br />';
         }
         $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $data['name']) . '<br />' . $data['display_price'];
     }
 }
Beispiel #6
0
 function getOutput()
 {
     global $osC_Product;
     if (!empty($osC_Product)) {
         return osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $osC_Product->getID()), $this->getIcon());
     }
 }
Beispiel #7
0
 function initialize()
 {
     global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
     if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         $data = array();
         $Qnew = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, 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 where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_random_select_new');
         $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
         $Qnew->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qnew->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qnew->bindInt(':default_flag', 1);
         $Qnew->bindInt(':language_id', $osC_Language->getID());
         $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
         $Qnew->executeRandomMulti();
         if ($Qnew->numberOfRows()) {
             $data = $Qnew->toArray();
             $osC_Product = new osC_Product($Qnew->valueInt('products_id'));
             $data['products_price'] = $osC_Product->getPriceFormated(true);
         }
         $osC_Cache->write('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), $data);
     }
     if (empty($data) === false) {
         $this->_content = '';
         if (empty($data['image']) === false) {
             $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $osC_Image->show($data['image'], $data['products_name'])) . '<br />';
         }
         $this->_content .= '<span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $data['products_name']) . '</span><br /><span class="productPrice">' . $data['products_price'] . '</span>';
     }
 }
Beispiel #8
0
 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 . '&nbsp;' . $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>';
     }
 }
Beispiel #9
0
 function initialize()
 {
     global $osC_Language, $osC_Template, $osC_ShoppingCart;
     $steps = array();
     if ($osC_ShoppingCart->getContentType() != 'virtual') {
         $steps[] = array('title' => $osC_Language->get('box_ordering_steps_delivery'), 'code' => 'shipping', 'active' => $osC_Template->getModule() == 'shipping' || $osC_Template->getModule() == 'shipping_address' ? true : false);
     }
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_payment'), 'code' => 'payment', 'active' => $osC_Template->getModule() == 'payment' || $osC_Template->getModule() == 'payment_address' ? true : false);
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_confirmation'), 'code' => 'confirmation', 'active' => $osC_Template->getModule() == 'confirmation' ? true : false);
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_complete'), 'active' => $osC_Template->getModule() == 'success' ? true : false);
     $content = osc_image('templates/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_preparing_to_ship.gif') . '<br />';
     $counter = 0;
     foreach ($steps as $step) {
         $counter++;
         $content .= '<span style="white-space: nowrap;">&nbsp;' . osc_image('templates/' . $osC_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(osc_href_link(FILENAME_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/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_ready_to_ship.gif');
     $this->_content = $content;
 }
Beispiel #10
0
 public function initialize()
 {
     global $current_category_id;
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     if (isset($current_category_id) && $current_category_id > 0) {
         $Qbestsellers = $OSCOM_Database->query('select distinct p.products_id, pd.products_name, pd.products_keyword from :table_products p, :table_products_description pd, :table_products_to_categories p2c, :table_categories c where p.products_status = 1 and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and :current_category_id in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit :max_display_bestsellers');
         $Qbestsellers->bindInt(':language_id', $OSCOM_Language->getID());
         $Qbestsellers->bindInt(':current_category_id', $current_category_id);
         $Qbestsellers->bindInt(':max_display_bestsellers', BOX_BEST_SELLERS_MAX_LIST);
         if (BOX_BEST_SELLERS_CACHE > 0) {
             $Qbestsellers->setCache('box_best_sellers-' . $current_category_id . '-' . $OSCOM_Language->getCode(), BOX_BEST_SELLERS_CACHE);
         }
         $Qbestsellers->execute();
     } else {
         $Qbestsellers = $OSCOM_Database->query('select p.products_id, pd.products_name, pd.products_keyword from :table_products p, :table_products_description pd where p.products_status = 1 and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_ordered desc, pd.products_name limit :max_display_bestsellers');
         $Qbestsellers->bindInt(':language_id', $OSCOM_Language->getID());
         $Qbestsellers->bindInt(':max_display_bestsellers', BOX_BEST_SELLERS_MAX_LIST);
         if (BOX_BEST_SELLERS_CACHE > 0) {
             $Qbestsellers->setCache('box_best_sellers-0-' . $OSCOM_Language->getCode(), BOX_BEST_SELLERS_CACHE);
         }
         $Qbestsellers->execute();
     }
     if ($Qbestsellers->numberOfRows() >= BOX_BEST_SELLERS_MIN_LIST) {
         $this->_content = '<ol style="margin: 0; padding: 0 0 0 20px;">';
         while ($Qbestsellers->next()) {
             $this->_content .= '<li>' . osc_link_object(OSCOM::getLink(null, 'Products', $Qbestsellers->value('products_keyword')), $Qbestsellers->value('products_name')) . '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qbestsellers->freeResult();
 }
Beispiel #11
0
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, 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) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
     $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
     $Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
     $Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qupcoming->bindInt(':default_flag', 1);
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':language_id', $osC_Language->getID());
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . ' ';
             if (osc_empty($Qupcoming->value('specials_new_products_price'))) {
                 $this->_content .= '(' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . ')';
             } else {
                 $this->_content .= '(<s>' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qupcoming->value('specials_new_products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</span>)';
             }
             $this->_content .= '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
Beispiel #12
0
 public function initialize()
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $OSCOM_Database = Registry::get('Database');
     $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_Database->query('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->executeRandomMulti();
             $data = array();
             if ($Qspecials->numberOfRows()) {
                 $data = $Qspecials->toArray();
                 $data['products_price'] = '<s>' . $OSCOM_Currencies->displayPrice($Qspecials->valueDecimal('products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</s>&nbsp;<span class="productSpecialPrice">' . $OSCOM_Currencies->displayPrice($Qspecials->valueDecimal('specials_new_products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</span>';
                 $OSCOM_Cache->write($data);
             }
         }
         if (!empty($data)) {
             $this->_content = '';
             if (!empty($data['image'])) {
                 $this->_content = osc_link_object(OSCOM::getLink(null, 'Products', $data['products_keyword']), $OSCOM_Image->show($data['image'], $data['products_name'])) . '<br />';
             }
             $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', $data['products_keyword']), $data['products_name']) . '<br />' . $data['products_price'];
         }
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
     if ($current_category_id < 1) {
         $Qproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, pf.sort_order, 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_products_frontpage pf where p.products_status = 1 and p.products_id = pd.products_id and pd.products_id = pf.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
     } else {
         $Qproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pf.sort_order, pd.products_keyword, 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_products_to_categories p2c, :table_categories c, :table_products_frontpage pf where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_id = pf.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
         $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
         $Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qproducts->bindInt(':parent_id', $current_category_id);
     }
     $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
     $Qproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qproducts->bindTable(':table_products_frontpage', TABLE_PRODUCTS_FRONTPAGE);
     $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qproducts->bindInt(':default_flag', 1);
     $Qproducts->bindInt(':language_id', $osC_Language->getID());
     $Qproducts->bindInt(':max_display_feature_products', MODULE_CONTENT_FEATURE_PRODUCTS_MAX_DISPLAY);
     $Qproducts->setCache('feature-products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id);
     $Qproducts->execute();
     if ($Qproducts->numberOfRows()) {
         $this->_content = '<div style="overflow: auto; height: 100%;">';
         $i = 0;
         while ($Qproducts->next()) {
             if ($i % 3 == 0 && $i != 0) {
                 $this->_content .= '<div style="clear:both"></div>';
             }
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $this->_content .= '<span style="width: 32%; float: left; text-align: center; padding: 2px;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name'))) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '<br />' . $osC_Product->getPriceFormated(true) . '</span>';
             $i++;
         }
         $this->_content .= '</div>';
     }
     $Qproducts->freeResult();
 }
Beispiel #14
0
 function initialize()
 {
     global $osC_Database, $osC_Cache, $osC_Language, $osC_Currencies, $osC_Image, $current_category_id;
     $data = array();
     if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0 && $osC_Cache->read('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         if ($current_category_id < 1) {
             $Qproducts = $osC_Database->query('select products_id from :table_products where products_status = :products_status and parent_id is null order by products_date_added desc limit :max_display_new_products');
         } else {
             $Qproducts = $osC_Database->query('select distinct p2c.products_id from :table_products p, :table_products_to_categories p2c, :table_categories c where c.parent_id = :category_parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_status = :products_status and p.parent_id is null order by p.products_date_added desc limit :max_display_new_products');
             $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
             $Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
             $Qproducts->bindInt(':category_parent_id', $current_category_id);
         }
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':products_status', 1);
         $Qproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $data[$osC_Product->getID()] = $osC_Product->getData();
             $data[$osC_Product->getID()]['display_price'] = $osC_Product->getPriceFormated(true);
             $data[$osC_Product->getID()]['display_image'] = $osC_Product->getImage();
         }
         $osC_Cache->write($data);
     }
     if (!empty($data)) {
         $this->_content = '<div style="overflow: auto; height: 100%;">';
         foreach ($data as $product) {
             $this->_content .= '<span style="width: 33%; float: left; text-align: center;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $osC_Image->show($product['display_image'], $product['name'])) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $product['name']) . '<br />' . $product['display_price'] . '</span>';
         }
         $this->_content .= '</div>';
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product;
     if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
         $Qmanufacturer = $osC_Database->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->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
         $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
         $Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
         $Qmanufacturer->bindInt(':languages_id', $osC_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $osC_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!osc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<div style="text-align: center;">' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), osc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</div>';
             }
             $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
             if (!osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($osC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>';
             }
             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $osC_Language->get('box_manufacturer_info_products')) . '</li>';
             $this->_content .= '</ol>';
         }
     }
 }
Beispiel #16
0
 function initialize()
 {
     global $osC_Language, $osC_Template, $toC_Compare_Products;
     if ($toC_Compare_Products->hasContents()) {
         $osC_Template->addStyleSheet('ext/multibox/multibox.css');
         $osC_Template->addJavascriptFilename('ext/multibox/Overlay.js');
         $osC_Template->addJavascriptFilename('ext/multibox/MultiBox.js');
         $this->_content = '<ul>';
         foreach ($toC_Compare_Products->getProducts() as $products_id) {
             $osC_Product = new osC_Product($products_id);
             $this->_content .= '<li>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $products_id . '&' . osc_get_all_get_params(array('action')) . '&action=compare_products_remove'), osc_draw_image_button('button_delete_icon.png', $osC_Language->get('button_delete')), 'style="float: right; margin: 0 3px 1px 3px"') . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id), $osC_Product->getTitle()) . '</li>';
         }
         $this->_content .= '</ul>';
         $this->_content .= '<p>' . '<span style="float: right">' . osc_link_object(osc_href_link(FILENAME_JSON, 'module=products&action=compare_products'), osc_draw_image_button('small_compare_now.png', $osC_Language->get('button_compare_now')), 'class="multibox" rel="width:800,height:400,ajax:true"') . '</span>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=compare_products_clear'), osc_draw_image_button('small_clear.png', $osC_Language->get('button_clear'))) . '&nbsp;&nbsp;' . '</p>';
         $js .= '<script type="text/javascript">
               window.addEvent("domready",function() {
                 var overlay = new Overlay(); 
                 var box = new MultiBox(\'multibox\', { 
                     overlay: overlay
                 });
               });
             </script>';
         $this->_content .= "\n" . $js;
     }
 }
Beispiel #17
0
 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
     if ($current_category_id < 1) {
         $Qnewproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, 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 where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_display_new_products');
     } else {
         $Qnewproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, 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_products_to_categories p2c, :table_categories c where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.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 p.products_date_added desc limit :max_display_new_products');
         $Qnewproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
         $Qnewproducts->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qnewproducts->bindInt(':parent_id', $current_category_id);
     }
     $Qnewproducts->bindTable(':table_products', TABLE_PRODUCTS);
     $Qnewproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qnewproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qnewproducts->bindInt(':default_flag', 1);
     $Qnewproducts->bindInt(':language_id', $osC_Language->getID());
     $Qnewproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0) {
         $Qnewproducts->setCache('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE);
     }
     $Qnewproducts->execute();
     if ($Qnewproducts->numberOfRows()) {
         $i = 0;
         while ($Qnewproducts->next()) {
             if ($i % 3 == 0 && $i != 0) {
                 $this->_content .= '<div style="clear:both"></div>';
             }
             $product = new osC_Product($Qnewproducts->valueInt('products_id'));
             $this->_content .= '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' . '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $Qnewproducts->value('products_name')) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $osC_Image->show($Qnewproducts->value('image'), $Qnewproducts->value('products_name')), 'id="productImage' . $Qnewproducts->value('products_id') . '"') . '<span style="display:block; padding: 3px; text-align: center">' . $product->getPriceFormated(true) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->valueInt('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_newproductsmodule_' . $Qnewproducts->value('products_id') . '"')) . '</div>';
             $i++;
         }
         $this->_content .= '<div style="clear:both"></div>';
     }
     $Qnewproducts->freeResult();
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Customer;
     if ($osC_Customer->isLoggedOn()) {
         $Qorders = $osC_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->bindTable(':table_orders', TABLE_ORDERS);
         $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qorders->bindTable(':table_products', TABLE_PRODUCTS);
         $Qorders->bindInt(':customers_id', $osC_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 = $osC_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->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
             $Qproducts->bindRaw(':products_id', $product_ids);
             $Qproducts->bindInt(':language_id', $osC_Language->getID());
             $Qproducts->execute();
             $this->_content = '<ol style="list-style: none; margin: 0; padding: 0;">';
             while ($Qproducts->next()) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '</li>';
             }
             $this->_content .= '</ol>';
         }
     }
 }
Beispiel #19
0
 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;">&nbsp;' . 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;
 }
Beispiel #20
0
 function initialize()
 {
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Image = Registry::get('Image');
     $this->_title_link = OSCOM::getLink(null, 'Products', 'All');
     $data = array();
     if (BOX_WHATS_NEW_CACHE > 0 && $OSCOM_Cache->read('box-whats_new-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
         $data = $OSCOM_Cache->getCache();
     } else {
         $Qnew = $OSCOM_Database->query('select products_id from :table_products where products_status = :products_status order by products_date_added desc limit :max_random_select_new');
         $Qnew->bindInt(':products_status', 1);
         $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
         $Qnew->executeRandomMulti();
         if ($Qnew->numberOfRows()) {
             $OSCOM_Product = new Product($Qnew->valueInt('products_id'));
             $data = $OSCOM_Product->getData();
             $data['display_price'] = $OSCOM_Product->getPriceFormated(true);
             $data['display_image'] = $OSCOM_Product->getImage();
         }
         $OSCOM_Cache->write($data);
     }
     if (!empty($data)) {
         $this->_content = '';
         if (!empty($data['display_image'])) {
             $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', $data['keyword']), $OSCOM_Image->show($data['display_image'], $data['name'])) . '<br />';
         }
         $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', $data['keyword']), $data['name']) . '<br />' . $data['display_price'];
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product, $osC_Image;
     if (isset($osC_Product)) {
         $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, i.image from :table_products_xsell px left join :table_products_images i on (px.xsell_products_id = i.products_id and i.default_flag = :default_flag), :table_products p, :table_products_description pd where px.xsell_products_id = p.products_id and p.products_id = pd.products_id and px.products_id = :products_id and p.products_status = 1 and pd.language_id = :language_id');
         $Qproducts->bindTable(':table_products_xsell', TABLE_PRODUCTS_XSELL);
         $Qproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':default_flag', 1);
         $Qproducts->bindInt(':products_id', $osC_Product->getID());
         $Qproducts->bindInt(':language_id', $osC_Language->getID());
         $Qproducts->execute();
         if ($Qproducts->numberOfRows() > 0) {
             $this->_content = '<div style="overflow: auto;">';
             while ($Qproducts->next()) {
                 $this->_content .= '<span style="width: 32%; float: left; padding: 3px; text-align: center">';
                 //            if (osc_empty($Qproducts->value('image')) === false) {
                 $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name'))) . '<br />';
                 //            }
                 $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '</span>';
             }
             $this->_content .= '</div>';
         }
         $Qproducts->freeResult();
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $constant = constant('BOX_SHOP_BY_PRICE_' . $osC_Currencies->getCode());
     if (!empty($constant)) {
         $prices = explode(";", $constant);
         if (is_array($prices) && sizeof($prices) > 0) {
             $this->_content = '<ol>';
             $pfrom = 0;
             $pto = 0;
             if (isset($_GET['pfrom']) && !empty($_GET['pfrom'])) {
                 $pfrom = $_GET['pfrom'];
             }
             if (isset($_GET['pto']) && !empty($_GET['pto'])) {
                 $pto = $_GET['pto'];
             }
             for ($n = 0; $n <= sizeof($prices); $n++) {
                 $filters = array();
                 if (isset($_GET['cPath']) && !empty($_GET['cPath'])) {
                     $filters[] = 'cPath=' . $_GET['cPath'];
                     if (isset($_GET['filter']) && !empty($_GET['filter'])) {
                         $filters[] = 'filter=' . $_GET['filter'];
                     }
                 }
                 if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {
                     $filters[] = 'manufacturers=' . $_GET['manufacturers'];
                     if (isset($_GET['filter']) && !empty($_GET['filter'])) {
                         $filters[] = 'filter=' . $_GET['filter'];
                     }
                 }
                 if ($n == 0) {
                     $price_section = $osC_Currencies->displayRawPrice(0) . ' ~ ' . $osC_Currencies->displayRawPrice($prices[$n]);
                     if ($pfrom == 0 && $pto == $prices[$n]) {
                         $price_section = '<b>' . $price_section . '</b>';
                     }
                     $params = 'keywords=' . $_GET['keywords'] . '&x=0&y=0&pfrom=' . 0 . '&pto=' . $prices[$n] . '&' . implode('&', $filters);
                 } else {
                     if ($n == sizeof($prices)) {
                         $price_section = $osC_Currencies->displayRawPrice($prices[$n - 1]) . ' + ';
                         if ($pfrom == $prices[$n - 1] && $pto == 0) {
                             $price_section = '<b>' . $price_section . '</b>';
                         }
                         $params = 'keywords=' . $_GET['keywords'] . '&x=0&y=0&pfrom=' . $prices[$n - 1] . '&pto=' . '&' . implode('&', $filters);
                     } else {
                         $price_section = $osC_Currencies->displayRawPrice($prices[$n - 1]) . ' ~ ' . $osC_Currencies->displayRawPrice($prices[$n]);
                         if ($pfrom == $prices[$n - 1] && $pto == $prices[$n]) {
                             $price_section = '<b>' . $price_section . '</b>';
                         }
                         $params = 'keywords=' . $_GET['keywords'] . '&x=0&y=0&pfrom=' . $prices[$n - 1] . '&pto=' . $prices[$n] . '&' . implode('&', $filters);
                     }
                 }
                 if (defined('BOX_SHOP_BY_PRICE_RECURSIVE') && (int) BOX_SHOP_BY_PRICE_RECURSIVE == 1) {
                     $params .= '&recursive=1';
                 }
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_SEARCH, $params), $price_section) . '</li>';
             }
             $this->_content .= '</ol>';
         }
     }
 }
 function getProducts()
 {
     global $osC_Database, $osC_Language, $toC_Json, $osC_Image;
     if (defined('IMAGE_GROUP_AUTO_COMPLETER')) {
         $image_group = IMAGE_GROUP_AUTO_COMPLETER;
     } else {
         $image_group = 'mini';
     }
     if (defined('MAX_CHARACTERS_AUTO_COMPLETER')) {
         $max_name_len = MAX_CHARACTERS_AUTO_COMPLETER;
     } else {
         $max_name_len = 40;
     }
     $products = array();
     if (isset($_POST['keywords']) && !empty($_POST['keywords'])) {
         $Qproducts = $osC_Database->query("select distinct p.products_id as products_id, pd.products_name from :table_products_description pd, :table_products p where pd.products_id = p.products_id and p.products_status = :products_status and products_name like :keywords and language_id =" . $osC_Language->getID() . ' limit :max_results');
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':products_status', 1);
         $Qproducts->bindInt(':max_results', MAX_DISPLAY_AUTO_COMPLETER_RESULTS);
         $Qproducts->bindValue(':keywords', '%' . $_POST['keywords'] . '%');
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $products_name = $Qproducts->value('products_name');
             if (strlen($products_name) > $max_name_len) {
                 $products_name = substr($products_name, 0, $max_name_len) . '...';
             }
             $products[] = '<div class="image">' . $osC_Image->show($osC_Product->getImage(), null, null, $image_group) . '</div><div class="details">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->valueInt('products_id')), $products_name) . '<strong class="price">' . $osC_Product->getPriceFormated(true) . '</strong></div>';
         }
     }
     echo $toC_Json->encode($products);
 }
Beispiel #24
0
 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();
     }
 }
 function initialize()
 {
     global $osC_Language, $osC_Template, $osC_Session, $osC_Currencies;
     $this->_title_link = osc_href_link(FILENAME_CHECKOUT, null, 'SSL');
     $content = '<div id="ajaxCartContent">' . '<div id="ajaxCartContentShort" class="collapsed">' . '<span class="cartTotal"></span>' . '<span class="quantity"></span> ' . $osC_Language->get('text_items') . '</div>' . '<div id="ajaxCartContentLong" class="expanded">' . '<ul class="products collapsed" id="ajaxCartContentProducts"><li></li></ul>' . '<p id="ajaxCartContentNoProducts" class="collapsed">' . $osC_Language->get('No products') . '</p>' . '<div id="ajaxCartButtons">' . osc_link_object(osc_href_link(FILENAME_CHECKOUT), osc_draw_image_button('button_ajax_cart.png'), 'id="ajax-shopping-button-cart"') . osc_link_object(osc_href_link(FILENAME_CHECKOUT, 'payment'), osc_draw_image_button('button_ajax_cart_checkout.png')) . '<div style="visibility:hidden">' . '<span>clear-bug-div</span>' . '</div>' . '</div>' . '</div>' . '</div>';
     $css = '#ajaxCartContent {overflow: hidden;}' . chr(13) . '.boxTitle #ajaxCartCollapse, .boxTitle #ajaxCartExpand {cursor:pointer;position:relative;top:3px;}' . chr(13) . '.hidden {display: none;}' . chr(13) . '.expanded {display: block;}' . chr(13) . '.collapsed {display: none;}' . chr(13) . '.strike {text-decoration:line-through;}' . chr(13) . '#ajaxCartContentShort span{ padding: 0 2px;}' . chr(13) . '#ajaxCartButtons {margin-top:10px;}' . chr(13) . '#ajaxCartButtons a {padding: 1px;text-align: center;text-decoration: none;}' . chr(13) . '#ajaxCartOrderTotals span.orderTotalText {float: left}' . chr(13) . '#ajaxCartContentLong ul.products {text-align: right;}' . chr(13) . '#ajaxCartContentLong ul li {padding: 6px 0;font-size: 9px;position: relative;line-height:16px;}' . chr(13) . '#ajaxCartContentLong ul.products span.price {display:block;position:absolute;left:15px;top:8px;}' . chr(13) . '#ajaxCartContentLong ul.products .removeProduct {cursor: pointer;display: block;width: 11px;height: 13px;position: absolute;left: 0;top: 8px;background: url(includes/languages/' . $osC_Language->getCode() . '/images/buttons/button_ajax_cart_delete.gif) no-repeat right top;}' . chr(13) . '#ajaxCartContentLong #ajax_cart_prices {padding: 5px 0;border-top : 1px dashed #777F7D;}' . chr(13) . '#ajaxCartOrderTotals {padding:5px 0;border-top: 1px dashed #CCCCCC;}' . chr(13) . '#ajaxCartContentLong #ajaxCartOrderTotals li {padding: 2px;font-size: 11px}' . chr(13) . '#ajaxCartContentLong p{color: #616060;font-size: 10px;margin: 0}' . chr(13) . '#ajaxCartContentLong p.variants, #ajaxCartContentLong p.customizations { padding: 2px;margin: 0 5px 0 0; }' . chr(13) . '#ajaxCartContentShort span.cartTotal {float:left; font-weight: bold}' . chr(13) . '#ajaxCartContentProducts dd span {display:block;padding-right:32px;}' . "\n\n";
     $osC_Template->addStyleDeclaration($css);
     $osC_Template->addJavascriptFilename('includes/javascript/ajax_shopping_cart.js');
     $enable_confirmation_dlg = false;
     if (defined('ENABLE_CONFIRMATION_DIALOG') && ENABLE_CONFIRMATION_DIALOG == '1') {
         $enable_confirmation_dlg = true;
     }
     $js .= '<script type="text/javascript">
             window.addEvent("domready",function() {
               ajaxCart = new AjaxShoppingCart({
                 sessionId : "' . $osC_Session->getID() . '",
                 currentUrl: "' . osc_get_current_url() . '",
                 error_sender_name_empty: "' . $osC_Language->get('error_sender_name_empty') . '",
                 error_sender_email_empty: "' . $osC_Language->get('error_sender_email_empty') . '",
                 error_recipient_name_empty: "' . $osC_Language->get('error_recipient_name_empty') . '",
                 error_recipient_email_empty: "' . $osC_Language->get('error_recipient_email_empty') . '",
                 error_message_empty: "' . $osC_Language->get('error_message_empty') . '",
                 error_message_open_gift_certificate_amount: "' . $osC_Language->get('error_message_open_gift_certificate_amount') . '",
                 dlgConfirmStatus: ' . $enable_confirmation_dlg . '
               });
             });
           </script>';
     $this->_content = $content . "\n" . $js;
 }
Beispiel #26
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_customers') . '</th>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_date') . '</th>' . '      <th>' . $osC_Language->get('summary_customers_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qcustomers = $osC_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->bindTable(':table_customers', TABLE_CUSTOMERS);
     $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(osc_href_link_admin(FILENAME_DEFAULT, 'customers&cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . '&nbsp;' . $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>';
     $Qcustomers->freeResult();
 }
Beispiel #27
0
 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Currencies, $osC_Cache, $osC_Language, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'specials');
     if ($osC_Services->isStarted('specials')) {
         if (BOX_SPECIALS_CACHE > 0 && $osC_Cache->read('box-specials-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_SPECIALS_CACHE)) {
             $data = $osC_Cache->getCache();
         } else {
             $Qspecials = $osC_Database->query('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->bindTable(':table_products', TABLE_PRODUCTS);
             $Qspecials->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
             $Qspecials->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
             $Qspecials->bindInt(':default_flag', 1);
             $Qspecials->bindTable(':table_specials', TABLE_SPECIALS);
             $Qspecials->bindInt(':language_id', $osC_Language->getID());
             $Qspecials->bindInt(':max_random_select_specials', BOX_SPECIALS_RANDOM_SELECT);
             $Qspecials->executeRandomMulti();
             $data = array();
             if ($Qspecials->numberOfRows()) {
                 $data = $Qspecials->toArray();
                 $data['products_price'] = '<s>' . $osC_Currencies->displayPrice($Qspecials->valueDecimal('products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</s>&nbsp;<span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qspecials->valueDecimal('specials_new_products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</span>';
                 $osC_Cache->write('box-specials-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), $data);
             }
         }
         if (empty($data) === false) {
             $this->_content = '';
             if (empty($data['image']) === false) {
                 $this->_content = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $osC_Image->show($data['image'], $data['products_name'])) . '<br />';
             }
             $this->_content .= '<span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $data['products_name']) . '</span><br /><span class="productPrice">' . $data['products_price'] . '</span>';
         }
     }
 }
Beispiel #28
0
 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>';
         }
     }
 }
/**
 * Build categories dropdown menu
 * 
 * @access public
 * @param $categories 
 * @param $data
 * @param $level
 * @param $parents_id
 * @return string
 */
function build_categories_dropdown_menu($parents_id = 0, $categories = null, $data = null, $level = 0)
{
    global $osC_CategoryTree;
    //if it is top category
    if ($parents_id == 0) {
        $data = $osC_CategoryTree->data;
        $categories = $data[0];
        $result = '<ul class="nav">';
    } else {
        $result = $parents_id == 0 ? '<ul role="menu" class="dropdown-menu" aria-labelledby="drop' . $parents_id . '">' : '<ul class="dropdown-menu">';
    }
    //add menu items
    if (is_array($categories) && !empty($categories)) {
        foreach ($categories as $categories_id => $categories) {
            $has_sub_category = in_array($categories_id, array_keys($data));
            $name = $parents_id == 0 && $has_sub_category == TRUE ? $categories['name'] . '&nbsp;&nbsp;<b class="caret"></b>' : $categories['name'];
            //li element
            if ($parents_id == 0) {
                $result .= $has_sub_category == TRUE ? '<li class="dropdown">' : '<li>';
            } else {
                $result .= $has_sub_category == TRUE ? '<li class="dropdown-submenu">' : '<li>';
            }
            $link_attributes = $parents_id == 0 && $has_sub_category == TRUE ? 'data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop' . $categories_id . '"' : '';
            $result .= osc_link_object(osc_href_link(FILENAME_DEFAULT, 'cPath=' . $categories_id), $name, $link_attributes);
            if ($has_sub_category) {
                $result .= build_categories_dropdown_menu($categories_id, $data[$categories_id], $data, $level + 1);
            }
            $result .= '</li>';
        }
    }
    $result .= '</ul>';
    return $result;
}
Beispiel #30
0
 function initialize()
 {
     global $osC_Database, $osC_Language;
     $Qmanufacturers = $osC_Database->query('select m.manufacturers_id as id, m.manufacturers_name as text, m.manufacturers_image as image from :table_manufacturers m, :table_manufacturers_info mi where m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id order by manufacturers_name');
     $Qmanufacturers->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
     $Qmanufacturers->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
     $Qmanufacturers->bindInt(':languages_id', $osC_Language->getID());
     $Qmanufacturers->setCache('box-manufacturers-' . $osC_Language->getCode(), 100);
     $Qmanufacturers->execute();
     if (BOX_MANUFACTURERS_LIST_TYPE == 'ComboBox') {
         $manufacturers_array = array(array('id' => '', 'text' => $osC_Language->get('pull_down_default')));
         while ($Qmanufacturers->next()) {
             $manufacturers_array[] = $Qmanufacturers->toArray();
         }
         $this->_content = '<form name="manufacturers" action="' . osc_href_link(FILENAME_DEFAULT, null, 'NONSSL', false) . '" method="get">' . osc_draw_pull_down_menu('manufacturers', $manufacturers_array, null, 'onchange="this.form.submit();" size="' . BOX_MANUFACTURERS_LIST_SIZE . '" style="width: 99%"') . osc_draw_hidden_session_id_field() . '</form>';
     } else {
         $this->_content = '<ul>';
         while ($Qmanufacturers->next()) {
             $manufacturers_image = $Qmanufacturers->value('image');
             if (!empty($manufacturers_image) && file_exists(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturers->value('image'))) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturers->valueInt('id')), osc_image("images/manufacturers/" . $Qmanufacturers->value('image'), $Qmanufacturers->value('text'))) . '</li>';
             }
         }
         $this->_content .= '</ul>';
     }
     $Qmanufacturers->freeResult();
 }