Example #1
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()
 {
     $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', '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_PDO->prepare('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->execute();
         $result = $Qnew->fetchAll();
         if (count($result) > 0) {
             $result = $result[rand(0, count($result) - 1)];
             $OSCOM_Product = new Product($result['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 .= HTML::link(OSCOM::getLink(null, 'Products', $data['keyword']), $OSCOM_Image->show($data['display_image'], $data['name'])) . '<br />';
         }
         $this->_content .= HTML::link(OSCOM::getLink(null, 'Products', $data['keyword']), $data['name']) . '<br />' . $data['display_price'];
     }
 }
Example #3
0
 public function initialize()
 {
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $Qupcoming = $OSCOM_Database->query('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%Y-%m-%d")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products');
     $Qupcoming->bindValue(':code', 'DateAvailable');
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $OSCOM_Product = new Product($Qupcoming->valueInt('products_id'));
             $this->_content .= '<li>' . DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()), $OSCOM_Product->getTitle()) . ' ' . $OSCOM_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
 public function initialize()
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $Qupcoming = $OSCOM_PDO->prepare('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%Y-%m-%d")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products');
     $Qupcoming->bindValue(':code', 'DateAvailable');
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     $result = $Qupcoming->fetchAll();
     if (!empty($result)) {
         $this->_content = '<ol style="list-style: none;">';
         foreach ($result as $r) {
             $OSCOM_Product = new Product($r['products_id']);
             $this->_content .= '<li>' . DateTime::getLong($r['date_expected']) . ': ' . HTML::link(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()), $OSCOM_Product->getTitle()) . ' ' . $OSCOM_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
 }
Example #5
0
 public function initialize()
 {
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $OSCOM_Category = Registry::get('Category');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Image = Registry::get('Image');
     $data = array();
     if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0 && $OSCOM_Cache->read('new_products-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode() . '-' . $OSCOM_Category->getID(), MODULE_CONTENT_NEW_PRODUCTS_CACHE)) {
         $data = $OSCOM_Cache->getCache();
     } else {
         if ($OSCOM_Category->getID() < 1) {
             $Qproducts = $OSCOM_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 = $OSCOM_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->bindInt(':category_parent_id', $OSCOM_Category->getID());
         }
         $Qproducts->bindInt(':products_status', 1);
         $Qproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $OSCOM_Product = new Product($Qproducts->valueInt('products_id'));
             $data[$OSCOM_Product->getID()] = $OSCOM_Product->getData();
             $data[$OSCOM_Product->getID()]['display_price'] = $OSCOM_Product->getPriceFormated(true);
             $data[$OSCOM_Product->getID()]['display_image'] = $OSCOM_Product->getImage();
         }
         $OSCOM_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(OSCOM::getLink(null, 'Products', $product['keyword']), $OSCOM_Image->show($product['display_image'], $product['name'])) . '<br />' . osc_link_object(OSCOM::getLink(null, 'Products', $product['keyword']), $product['name']) . '<br />' . $product['display_price'] . '</span>';
         }
         $this->_content .= '</div>';
     }
 }
Example #6
0
 function getProducts()
 {
     $history = array();
     if (isset($this->visits['products']) && empty($this->visits['products']) === false) {
         $counter = 0;
         foreach ($this->visits['products'] as $k => $v) {
             $counter++;
             $OSCOM_Product = new Product($v['id']);
             $OSCOM_Category = new Category($OSCOM_Product->getCategoryID());
             $history[] = array('name' => $OSCOM_Product->getTitle(), 'id' => $OSCOM_Product->getID(), 'keyword' => $OSCOM_Product->getKeyword(), 'price' => SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_PRICES == '1' ? $OSCOM_Product->getPriceFormated(true) : '', 'image' => $OSCOM_Product->getImage(), 'category_name' => $OSCOM_Category->getTitle(), 'category_path' => $OSCOM_Category->getPath());
             if ($counter == SERVICE_RECENTLY_VISITED_MAX_PRODUCTS) {
                 break;
             }
         }
     }
     return $history;
 }
Example #7
0
  <tr>
    <td width="<?php 
        echo $OSCOM_Image->getWidth('thumbnails') + 10;
        ?>
" valign="top" align="center">

<?php 
        if ($OSCOM_Product->hasImage()) {
            echo osc_link_object(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle()));
        }
        ?>

    </td>
    <td valign="top"><?php 
        echo osc_link_object(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()), '<b><u>' . $OSCOM_Product->getTitle() . '</u></b>') . '<br />' . OSCOM::getDef('date_added') . ' ' . DateTime::getLong($OSCOM_Product->getDateAdded()) . '<br />' . OSCOM::getDef('manufacturer') . ' ' . $OSCOM_Product->getManufacturer() . '<br /><br />' . OSCOM::getDef('price') . ' ' . $OSCOM_Product->getPriceFormated();
        ?>
</td>
    <td align="right" valign="middle"><?php 
        echo osc_link_object(OSCOM::getLink(null, 'Cart', 'Add&' . $OSCOM_Product->getKeyword()), osc_draw_image_button('button_in_cart.gif', OSCOM::getDef('button_add_to_cart')));
        ?>
</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>

<?php 
    }
} else {
    ?>
Example #8
0
     if (isset($_GET['manufacturers'])) {
         $lc_text = osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword() . '&manufacturers=' . $_GET['manufacturers']), $OSCOM_Product->getTitle());
     } else {
         $lc_text = '&nbsp;' . osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword() . ($OSCOM_Category->getID() > 0 ? '&cPath=' . $OSCOM_Category->getPath() : '')), $OSCOM_Product->getTitle()) . '&nbsp;';
     }
     break;
 case 'PRODUCT_LIST_MANUFACTURER':
     $lc_align = '';
     $lc_text = '&nbsp;';
     if ($OSCOM_Product->hasManufacturer()) {
         $lc_text = '&nbsp;' . osc_link_object(OSCOM::getLink(null, 'Index', 'manufacturers=' . $OSCOM_Product->getManufacturerID()), $OSCOM_Product->getManufacturer()) . '&nbsp;';
     }
     break;
 case 'PRODUCT_LIST_PRICE':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $OSCOM_Product->getPriceFormated() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $OSCOM_Product->getQuantity() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $OSCOM_Product->getWeight() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_IMAGE':
     $lc_align = 'center';
     if (isset($_GET['manufacturers'])) {
         $lc_text = osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword() . '&manufacturers=' . $_GET['manufacturers']), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle()));
     } else {
         $lc_text = '&nbsp;' . osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword() . ($OSCOM_Category->getID() > 0 ? '&cPath=' . $OSCOM_Category->getPath() : '')), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle())) . '&nbsp;';