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 execute() { global $osC_Database, $osC_Session, $osC_NavigationHistory, $osC_Customer; if (!$osC_Customer->isLoggedOn()) { $osC_NavigationHistory->setSnapshot(); osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL')); return false; } $id = false; foreach ($_GET as $key => $value) { if ((ereg('^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) { $id = $key; } break; } if ($id !== false && osC_Product::checkEntry($id)) { $osC_Product = new osC_Product($id); $Qcheck = $osC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1'); $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qcheck->bindInt(':customers_id', $osC_Customer->getID()); $Qcheck->bindInt(':products_id', $osC_Product->getID()); $Qcheck->execute(); if ($Qcheck->numberOfRows() > 0) { $Qn = $osC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id = :products_id'); $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qn->bindInt(':customers_id', $osC_Customer->getID()); $Qn->bindInt(':products_id', $osC_Product->getID()); $Qn->execute(); } } osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')))); }
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>'; } } } }
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'))) . ' ' . '</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; } }
function initialize() { $OSCOM_Language = Registry::get('Language'); $this->_content = ''; foreach ($OSCOM_Language->getAll() as $value) { $this->_content .= ' ' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $OSCOM_Language->showImage($value['code'])) . ' '; } }
function initialize() { global $osC_Language, $request_type; $this->_content = ''; foreach ($osC_Language->getAll() as $value) { $this->_content .= ' ' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $osC_Language->showImage($value['code'])) . ' '; } }
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); $cid = $products_id; $str_variants = ''; //if the product have any variants, it means that the $products_id should be a product string such as 1#1:1;2:2 if ($osC_Product->hasVariants()) { $variants = $osC_Product->getVariants(); if (preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)+$/', $products_id)) { $products_variant = $variants[$products_id]; } else { $products_variant = $osC_Product->getDefaultVariant(); } //if the product have any variants, get the group_name:value_name string if (isset($products_variant) && isset($products_variant['groups_name']) && is_array($products_variant['groups_name']) && !empty($products_variant['groups_name'])) { $str_variants .= ' -- '; foreach ($products_variant['groups_name'] as $groups_name => $value_name) { $str_variants .= '<strong>' . $groups_name . ': ' . $value_name . '</strong>;'; } //clean the last ';' if (($pos = strrpos($str_variants, ';')) !== false) { $str_variants = substr($str_variants, 0, -1); } } //build the product string that could be used if (strpos($products_id, '#') !== false) { $cid = str_replace('#', '_', $products_id); } } $this->_content .= '<li>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), 'cid=' . $cid . '&' . osc_get_all_get_params(array('cid', '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() . $str_variants) . '</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="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'))) . ' ' . '</p>'; $js .= '<script type="text/javascript"> window.addEvent("domready",function() { var box = new MultiBox(\'multibox\', { movieWidth: 820, movieHeight: 600 }); }); </script>'; $this->_content .= "\n" . $js; } }
function initialize() { global $osC_Language, $toC_Compare_Products; if ($toC_Compare_Products->hasContents()) { $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('javascript:popupWindow(\'' . osc_href_link(FILENAME_PRODUCTS, 'compare_products') . '\', \'popupWindow\', \'scrollbars=yes\');', osc_draw_image_button('small_compare_now.png', $osC_Language->get('button_compare_now'))) . '</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'))) . ' ' . '</p>'; } }
function execute() { global $osC_Session, $toC_Compare_Products; //the cid must be a numeric or the string as 1#1:1;2:2 if (isset($_GET['cid'])) { if (preg_match('/^[0-9]+(_?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $_GET['cid']) || preg_match('^[a-zA-Z0-9 -_]*$', $_GET['cid'])) { $cid = $_GET['cid']; if (strpos($cid, '_') !== false) { $cid = str_replace('_', '#', $cid); } } $toC_Compare_Products->deleteProduct($cid); osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('cid', 'action')))); } }
function execute() { global $osC_Database, $osC_Session, $osC_NavigationHistory, $osC_Customer; if (!$osC_Customer->isLoggedOn()) { $osC_NavigationHistory->setSnapshot(); osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL')); return false; } $notifications = array(); if (isset($_GET['products']) && !empty($_GET['products'])) { $products_array = explode(';', $_GET['products']); foreach ($products_array as $product_id) { if (is_numeric($product_id) && !in_array($product_id, $notifications)) { $notifications[] = $product_id; } } } else { $id = false; foreach ($_GET as $key => $value) { if ((ereg('^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) { $id = $key; } break; } if ($id !== false && osC_Product::checkEntry($id)) { $osC_Product = new osC_Product($id); $notifications[] = $osC_Product->getID(); } } if (!empty($notifications)) { foreach ($notifications as $product_id) { $Qcheck = $osC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1'); $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qcheck->bindInt(':customers_id', $osC_Customer->getID()); $Qcheck->bindInt(':products_id', $product_id); $Qcheck->execute(); if ($Qcheck->numberOfRows() < 1) { $Qn = $osC_Database->query('insert into :table_products_notifications (products_id, customers_id, date_added) values (:products_id, :customers_id, :date_added)'); $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qn->bindInt(':products_id', $product_id); $Qn->bindInt(':customers_id', $osC_Customer->getID()); $Qn->bindRaw(':date_added', 'now()'); $Qn->execute(); } } } osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')))); }
function osC_Search_Search() { global $osC_Services, $osC_Language, $breadcrumb, $osC_Search; $this->_page_title = $osC_Language->get('search_heading'); $osC_Search = new osC_Search(); if (isset($_GET['keywords'])) { $this->_page_title = $osC_Language->get('search_results_heading'); $this->_page_contents = 'results.php'; if ($osC_Services->isStarted('breadcrumb')) { $breadcrumb->add($osC_Language->get('breadcrumb_search_results'), osc_href_link(FILENAME_SEARCH, osc_get_all_get_params())); } $this->_process(); } else { $this->addJavascriptPhpFilename('templates/' . $this->getCode() . '/javascript/search/search.php'); } }
function execute() { global $osC_Session, $toC_Compare_Products; $id = false; foreach ($_GET as $key => $value) { if ((ereg('^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) { if (ereg('^[0-9]', $key)) { $id = $key; } } } if (isset($id) && is_numeric($id)) { $toC_Compare_Products->deleteProduct($id); } osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array($id, 'action')))); }
function execute() { global $osC_Session, $toC_Compare_Products; $link = osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $params = osc_get_all_get_params(array('cid', 'action'))); //Get the compare products id string if (isset($_GET['cid'])) { $cid = $_GET['cid']; if (strpos($cid, '_') !== false) { $cid = str_replace('_', '#', $cid); } //if the products have any variants, the string should be formated as 1#1:1;2:1 if (preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $cid) || preg_match('/^[a-zA-Z0-9 -_]*$/', $cid)) { $toC_Compare_Products->addProduct($cid); $link = preg_replace('/^products.php?[a-zA-Z0-9 -_]*$/i', 'products.php?' . $cid, $link); } } osc_redirect($link); }
<div id="productImages"> <?php echo osc_link_object('javascript:void(0)', $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle(), ' large-img="' . $osC_Image->getImageUrl($osC_Product->getImage(), 'large') . '" id="product_image" style="padding:0px;border:0px;"', 'product_info'), 'id="defaultProductImage"'); echo '<div style="clear:both"></div>'; $images = $osC_Product->getImages(); foreach ($images as $image) { echo osc_link_object($osC_Image->getImageUrl($image['image'], 'originals'), $osC_Image->show($image['image'], $osC_Product->getTitle(), '', 'mini'), 'rel="milkbox:group_products" product-info-img="' . $osC_Image->getImageUrl($image['image'], 'product_info') . '" large-img="' . $osC_Image->getImageUrl($image['image'], 'large') . '" style="float:left" class="mini"') . "\n"; } ?> </div> </div> <form id="cart_quantity" name="cart_quantity" action="<?php echo osc_href_link(FILENAME_PRODUCTS, osc_get_all_get_params(array('action')) . '&action=cart_add'); ?> " method="post"> <table id="productInfo" border="0" cellspacing="0" cellpadding="2" style="float: right; width: 270px"> <tr> <td colspan="2" id="productInfoPrice"><?php echo $osC_Product->getPriceFormated(true) . ' ' . (DISPLAY_PRICE_WITH_TAX == '1' ? $osC_Language->get('including_tax') : ''); ?> </td> </tr> <tr> <td class="label" width="45%"><?php echo $osC_Language->get('field_sku');
public static function execute(ApplicationAbstract $application) { $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); $OSCOM_Search = Registry::get('Search'); $OSCOM_MessageStack = Registry::get('MessageStack'); $application->setPageTitle(OSCOM::getDef('search_results_heading')); $application->setPageContent('results.php'); if ($OSCOM_Service->isStarted('Breadcrumb')) { $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_search_results'), OSCOM::getLink(null, null, osc_get_all_get_params())); } if (isset($_GET['datefrom_days']) && is_numeric($_GET['datefrom_days']) && isset($_GET['datefrom_months']) && is_numeric($_GET['datefrom_months']) && isset($_GET['datefrom_years']) && is_numeric($_GET['datefrom_years'])) { if (checkdate($_GET['datefrom_months'], $_GET['datefrom_days'], $_GET['datefrom_years'])) { $OSCOM_Search->setDateFrom(mktime(0, 0, 0, $_GET['datefrom_months'], $_GET['datefrom_days'], $_GET['datefrom_years'])); } else { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_from_date')); } } if (isset($_GET['dateto_days']) && is_numeric($_GET['dateto_days']) && isset($_GET['dateto_months']) && is_numeric($_GET['dateto_months']) && isset($_GET['dateto_years']) && is_numeric($_GET['dateto_years'])) { if (checkdate($_GET['dateto_months'], $_GET['dateto_days'], $_GET['dateto_years'])) { $OSCOM_Search->setDateTo(mktime(23, 59, 59, $_GET['dateto_months'], $_GET['dateto_days'], $_GET['dateto_years'])); } else { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_to_date')); } } if ($OSCOM_Search->hasDateSet()) { if ($OSCOM_Search->getDateFrom() > $OSCOM_Search->getDateTo()) { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_to_date_less_than_from_date')); } } if (isset($_GET['pfrom']) && !empty($_GET['pfrom'])) { if (settype($_GET['pfrom'], 'double')) { $OSCOM_Search->setPriceFrom($_GET['pfrom']); } else { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_from_not_numeric')); } } if (isset($_GET['pto']) && !empty($_GET['pto'])) { if (settype($_GET['pto'], 'double')) { $OSCOM_Search->setPriceTo($_GET['pto']); } else { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_to_not_numeric')); } } if ($OSCOM_Search->hasPriceSet('from') && $OSCOM_Search->hasPriceSet('to') && $OSCOM_Search->getPriceFrom() >= $OSCOM_Search->getPriceTo()) { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_to_less_than_price_from')); } if (isset($_GET['Q']) && is_string($_GET['Q']) && !empty($_GET['Q'])) { $OSCOM_Search->setKeywords(urldecode($_GET['Q'])); if ($OSCOM_Search->hasKeywords() === false) { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_keywords')); } } if (!$OSCOM_Search->hasKeywords() && !$OSCOM_Search->hasPriceSet('from') && !$OSCOM_Search->hasPriceSet('to') && !$OSCOM_Search->hasDateSet('from') && !$OSCOM_Search->hasDateSet('to')) { $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_at_least_one_input')); } if (isset($_GET['category']) && is_numeric($_GET['category']) && $_GET['category'] > 0) { $OSCOM_Search->setCategory($_GET['category'], isset($_GET['recursive']) && $_GET['recursive'] == '1' ? true : false); } if (isset($_GET['manufacturer']) && is_numeric($_GET['manufacturer']) && $_GET['manufacturer'] > 0) { $OSCOM_Search->setManufacturer($_GET['manufacturer']); } if (isset($_GET['sort']) && !empty($_GET['sort'])) { if (strpos($_GET['sort'], '|d') !== false) { $OSCOM_Search->setSortBy(substr($_GET['sort'], 0, -2), '-'); } else { $OSCOM_Search->setSortBy($_GET['sort']); } } if ($OSCOM_MessageStack->size('Search') > 0) { $application->setPageContent('main.php'); } }
?> <p><?php echo OSCOM::getDef('number_of_product_reviews') . ' ' . Reviews::getTotal(osc_get_product_id($OSCOM_Product->getID())); ?> </p> <?php } if ($OSCOM_Product->hasURL()) { ?> <p><?php echo sprintf(OSCOM::getDef('go_to_external_products_webpage'), OSCOM::getLink(null, 'Redirect', 'action=url&goto=' . urlencode($OSCOM_Product->getURL()), 'NONSSL', null, false)); ?> </p> <?php } ?> <div class="submitFormButtons" style="text-align: right;"> <?php if ($OSCOM_Service->isStarted('Reviews')) { echo osc_link_object(OSCOM::getLink(null, null, 'Reviews&' . osc_get_all_get_params()), osc_draw_image_button('button_reviews.gif', OSCOM::getDef('button_reviews'))); } ?> </div>
<?php } else { echo $osC_Language->get('no_products_in_category'); } ?> </div> <?php if ($Qlisting->numberOfRows() > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) { ?> <div class="listingPageLinks clearfix"> <?php echo $Qlisting->getBatchPageLinks('page', osc_get_all_get_params(array('page', 'info', 'x', 'y')), false); ?> <div class="totalPages"><?php echo $Qlisting->getBatchTotalPages($osC_Language->get('result_set_number_of_products')); ?> </div> </div> <?php } ?> <?php if ($variants_enabled) { ?>
} ?> <tr> <td colspan="2" align="left" valign="top" style="padding-top: 15px" id="shoppingCart"> <?php echo '<b>' . $osC_Language->get('field_short_quantity') . '</b> ' . osc_draw_input_field('quantity', $osC_Product->getMOQ(), 'size="3"') . ' ' . osc_draw_image_submit_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart'), 'style="vertical-align:middle;" class="ajaxAddToCart" id="ac_productsinfo_' . osc_get_product_id($osC_Product->getID()) . '"'); ?> </td> </tr> <tr> <td colspan="2" align="center" id = "shoppingAction"> <?php if ($osC_Template->isInstalled('compare_products', 'boxes')) { echo osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params() . '&cid=' . $osC_Product->getID() . '&' . '&action=compare_products_add'), $osC_Language->get('add_to_compare'), 'class="compare-products"') . ' <span>|</span> '; } echo osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $osC_Product->getID() . '&action=wishlist_add'), $osC_Language->get('add_to_wishlist'), 'class="wishlist"'); ?> </td> </tr> <tr> <td colspan="2"> <p class="shortDescription"><?php echo $osC_Product->getShortDescription(); ?> </p> </td> </tr> </table> </form>
echo substr($description, 0, 300) . (strlen($description) >= 100 ? '..' : ''); ?> </p> <div style="clear: both;"></div> </div> </div> <?php } ?> <div class="listingPageLinks"> <span style="float: left;"><?php echo $Qarticles->getBatchPageLinks('page', osc_get_all_get_params(array('x', 'y'))); ?> </span> <?php echo $Qarticles->getBatchTotalPages($osC_Language->get('result_set_number_of_articles')); ?> </div> <?php } else { ?> <div class="moduleBox"> <div class="content"> <?php
function execute() { global $toC_Compare_Products; $toC_Compare_Products->reset(); osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')))); }
?> </h1> <?php if ($messageStack->size('reviews') > 0) { echo $messageStack->output('reviews'); } if ($osC_Product->hasImage()) { ?> <div style="float: right; text-align: center;"> <?php echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'images&' . $osC_Product->getID()), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle(), 'hspace="5" vspace="5"', 'thumbnail'), 'target="_blank" onclick="window.open(\'' . osc_href_link(FILENAME_PRODUCTS, 'images&' . $osC_Product->getID()) . '\', \'popUp\', \'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' . ($osC_Product->numberOfImages() > 1 ? $osC_Image->getWidth('large') + $osC_Image->getWidth('thumbnails') * 2 + 70 : $osC_Image->getWidth('large') + 20) . ',height=' . ($osC_Image->getHeight('large') + 20) . '\'); return false;"'); ?> <?php echo '<p>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $osC_Product->getID() . '&' . osc_get_all_get_params(array('action')) . '&action=cart_add'), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart'))) . '</p>'; ?> </div> <?php } if ($osC_Product->getData('reviews_average_rating') > 0) { ?> <p><?php echo $osC_Language->get('average_rating') . ' ' . osc_image(DIR_WS_IMAGES . 'stars_' . $osC_Product->getData('reviews_average_rating') . '.png', sprintf($osC_Language->get('rating_of_5_stars'), $osC_Product->getData('reviews_average_rating'))); ?> </p> <?php }
?> " class="btn btn-small btn-info ajaxAddToCart" href="<?php echo osc_href_link(FILENAME_PRODUCTS, $product['products_id'] . '&action=cart_add'); ?> "> <i class="icon-shopping-cart icon-white "></i> <?php echo $osC_Language->get('button_buy_now'); ?> </a> <br /> <?php echo osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $product['products_id'] . '&action=wishlist_add'), $osC_Language->get('add_to_wishlist'), 'class="wishlist"'); ?> <?php if ($osC_Template->isInstalled('compare_products', 'boxes')) { echo '<br />' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params() . '&cid=' . $product['products_id'] . '&' . '&action=compare_products_add'), $osC_Language->get('add_to_compare'), 'class="compare"'); } ?> </span> </div> </li> <?php } ?> </ul> </div> <!-- module new_products end //--> <?php }
</h6> <div class="moduleBox"> <div class="content"><?php echo $osC_Product->getDescription(); ?> </div> </div> <div style="clear: both;"></div> <div class="submitFormButtons" style="text-align: right;"> <?php if ($osC_Services->isStarted('reviews')) { echo '<span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews&' . osc_get_all_get_params()), osc_draw_image_button('button_reviews.gif', $osC_Language->get('button_reviews'))) . '</span>'; } ?> </div> <?php if ($osC_Services->isStarted('reviews') && osC_Reviews::exists(osc_get_product_id($osC_Product->getID()))) { ?> <p><?php echo $osC_Language->get('number_of_product_reviews') . ' ' . osC_Reviews::getTotal(osc_get_product_id($osC_Product->getID())); ?> </p> <?php
<!-- END: Navigation --> <?php if ($osC_Services->isStarted('breadcrumb')) { ?> <!-- BEGIN: Breadcrumb --> <div class="container"> <div class="breadcrumb hidden-phone"> <?php echo $breadcrumb->trail(' » '); ?> <div class="pull-right flags"> <?php foreach ($osC_Language->getAll() as $value) { echo osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $osC_Language->showImage($value['code'])); } ?> </div> </div> </div> <!-- END: Breadcrumb --> <?php } ?> <?php } ?> <!-- slideshow -->
} } else { if ($Qlisting->value('products_type') == PRODUCT_TYPE_SIMPLE) { $lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qlisting->value('products_id') . ($cPath ? '&cPath=' . $cPath : '')), $osC_Image->show($Qlisting->value('image'), $Qlisting->value('products_name')), 'id="productImage' . $Qlisting->value('products_id') . '"'); } else { $lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qlisting->value('products_id') . ($cPath ? '&cPath=' . $cPath : '')), $osC_Image->show($Qlisting->value('image'), $Qlisting->value('products_name'))); } } break; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; if ($Qlisting->value('products_type') == PRODUCT_TYPE_SIMPLE) { $lc_text = osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qlisting->value('products_id') . '&' . osc_get_all_get_params(array('action')) . '&action=cart_add'), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'), 'class="ajaxAddToCart" id="ac_productlisting_' . $Qlisting->value('products_id') . '"')) . ' <br />'; } else { $lc_text = osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qlisting->value('products_id') . '&' . osc_get_all_get_params(array('action')) . '&action=cart_add'), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'))) . ' <br />'; } $lc_text .= osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qlisting->value('products_id') . '&' . osc_get_all_get_params(array('action')) . '&action=compare_products_add'), $osC_Language->get('add_to_compare')) . ' <br />'; $lc_text .= osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qlisting->value('products_id') . '&' . osc_get_all_get_params(array('action')) . '&action=wishlist_add'), $osC_Language->get('add_to_wishlist')); break; } $grid_html .= '<div class="productsGrid-item">' . $lc_text . '</div>'; } $grid_html .= '</div>'; } echo $grid_html; ?> <div class="clear"></div> </div> </div>
/** * Create a sort heading with appropriate sort link * * @param string $key The key used for sorting * @param string $heading The heading to use the link on * @access public */ function osc_create_sort_heading($key, $heading) { global $osC_Language; $current = false; $direction = false; if (!isset($_GET['sort'])) { $current = 'name'; } elseif ($_GET['sort'] == $key || $_GET['sort'] == $key . '|d') { $current = $key; } if ($key == $current) { if (isset($_GET['sort'])) { $direction = $_GET['sort'] == $key ? '+' : '-'; } else { $direction = '+'; } } return osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('page', 'sort')) . '&sort=' . $key . ($direction == '+' ? '|d' : '')), $heading . ($key == $current ? $direction : ''), 'title="' . (isset($_GET['sort']) && $_GET['sort'] == $key ? sprintf($osC_Language->get('listing_sort_ascendingly'), $heading) : sprintf($osC_Language->get('listing_sort_descendingly'), $heading)) . '" class="productListing-heading"'); }
/** * Create a sort heading with appropriate sort link * * @param string $key The key used for sorting * @param string $heading The heading to use the link on * @access public */ function osc_create_sort_heading($key, $heading) { $current = false; $direction = false; if (!isset($_GET['sort'])) { $current = 'name'; } elseif ($_GET['sort'] == $key || $_GET['sort'] == $key . '|d') { $current = $key; } if ($key == $current) { if (isset($_GET['sort'])) { $direction = $_GET['sort'] == $key ? '+' : '-'; } else { $direction = '+'; } } return osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('page', 'sort')) . '&sort=' . $key . ($direction == '+' ? '|d' : '')), $heading . ($key == $current ? $direction : ''), 'title="' . (isset($_GET['sort']) && $_GET['sort'] == $key ? sprintf(OSCOM::getDef('listing_sort_ascendingly'), $heading) : sprintf(OSCOM::getDef('listing_sort_descendingly'), $heading)) . '" class="productListing-heading"'); }
?> </li> <?php } ?> </ul> <p> <span style="float: right"><a class="btn btn-mini multibox" rel="ajax:true" href="<?php echo osc_href_link(FILENAME_JSON, 'module=products&action=compare_products&template=' . $osC_Template->getCode()); ?> "><?php echo $osC_Language->get('button_compare_now'); ?> </a></span> <a class="btn btn-mini" href="<?php echo osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=compare_products_clear'); ?> "><?php echo $osC_Language->get('button_clear'); ?> </a> </p> <script type="text/javascript"> window.addEvent("domready",function() { var box = new MultiBox('multibox', { movieWidth: 820, movieHeight: 600 }); }); </script> </div>