function execute() { global $currencies, $oscTemplate; if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } if ($this->group == 'boxes_footer') { $data = '<div class="col-sm-3 col-lg-2">' . ' <div class="footerbox best-sellers">' . ' <h2><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></h2>'; } else { $data = '<div class="panel panel-default">' . ' <div class="panel-heading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>'; } $data .= ' <div class="panel-body text-center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . '</div>'; $data .= '</div>'; if ($this->group == 'boxes_footer') { $data .= '</div>'; } $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } $data = NULL; if ($this->group == 'boxes_product_page') { $data .= '<div class="col-sm-4 product_box">'; } $data .= '<div class="panel panel-default">' . ' <div class="panel-heading">' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></div>' . ' <div class="panel-body">' . $notif_contents . '</div>' . '</div>'; if ($this->group == 'boxes_product_page') { $data .= '</div>'; } $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $currencies, $oscTemplate; if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<del class="old-price price">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; $whats_new_price .= '<span class="new-price price">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = '<span class="price">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } $data = '<div class="module new-products-box">' . ' <h3 class="module-heading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></h3>' . ' <ul class="module-content boxproduct">' . ' <li class="clearfix">' . ' <a class="boxproduct-img" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', '') . '</a>' . ' <div class="boxproduct-info">' . ' <a class="product-name boxproduct-name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a>' . ' <div class="price-box">' . $whats_new_price . '</div>' . ' </div>' . ' </li>' . ' </ul>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $currencies, $oscTemplate; if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } ob_start(); include 'includes/modules/boxes/templates/whats_new.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $currencies, $oscTemplate; if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); if (tep_not_null($random_product['specials_new_products_price'])) { // $whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; // osc-support-edition BOF $whats_new_price = '<del>' . $currencies->display_price_normal($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; // osc-support-edition EOF $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>' . ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = ' <ul class="module-content">' . ' <li>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_draw_icon('fa-chain-broken') . '</a>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>' . ' </li>' . ' </ul>'; } else { $notif_contents = ' <ul class="module-content">' . ' <li>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_draw_icon('fa-pencil-square-o') . '</a>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>' . ' </li>' . ' </ul>'; } $data = '<div class="module notify-box">' . ' <h3 class="module-heading"><a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></h3>' . ' ' . $notif_contents . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'; } else { $notif_contents = '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'; } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></div>' . ' ' . $notif_contents . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $PHP_SELF, $request_type, $oscTemplate; if (isset($_GET['products_id'])) { if (isset($_SESSION['customer_id'])) { $Qcheck = Registry::get('Db')->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); $notification_exists = $Qcheck->fetch() !== false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($_GET['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($_GET['products_id'])) . '</a>'; } ob_start(); include 'includes/modules/boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $currencies, $oscTemplate; $OSCOM_Db = Registry::get('Db'); $Qcheck = $OSCOM_Db->query('select products_id, products_image, products_tax_class_id, products_price from :table_products where products_status = 1 order by products_date_added desc limit ' . (int) MAX_RANDOM_SELECT_NEW); $result = $Qcheck->fetchAll(); if (count($result) > 0) { $random_product = $result[mt_rand(0, count($result) - 1)]; $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } ob_start(); include 'includes/modules/boxes/templates/whats_new.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $PHP_SELF, $oscTemplate; if (isset($_GET['products_id'])) { if (isset($_SESSION['customer_id'])) { $Qcheck = Registry::get('Db')->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => (int) $_GET['products_id']]); $notification_exists = $Qcheck->fetch() !== false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove') . '"><span class="fa fa-remove"></span> ' . OSCOM::getDef('module_boxes_product_notifications_box_notify_remove', ['products_name' => tep_get_products_name($_GET['products_id'])]) . '</a>'; } else { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify') . '"><span class="fa fa-envelope"></span> ' . OSCOM::getDef('module_boxes_product_notifications_box_notify', ['products_name' => tep_get_products_name($_GET['products_id'])]) . '</a>'; } ob_start(); include 'includes/modules/boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } ob_start(); include DIR_WS_MODULES . 'boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function getOutput() { global $oscTemplate; // add the js in the footer $oscTemplate->addBlock('<script src="//assets.pinterest.com/js/pinit.js"></script>', 'footer_scripts'); $params = array(); // grab the product name (used for description) $params['description'] = tep_get_products_name($_GET['products_id']); // and image (used for media) $image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int) $_GET['products_id'] . "'"); $image = tep_db_fetch_array($image_query); if (tep_not_null($image['products_image'])) { $image_file = $image['products_image']; $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int) $_GET['products_id'] . "' order by sort_order"); if (tep_db_num_rows($pi_query) > 0) { while ($pi = tep_db_fetch_array($pi_query)) { if (tep_not_null($pi['image'])) { $image_file = $pi['image']; // overwrite image with first multiple product image break; } } } $params['media'] = tep_href_link('images/' . $image_file, '', 'NONSSL', false); } // url $params['url'] = tep_href_link('product_info.php', 'products_id=' . $_GET['products_id'], 'NONSSL', false); $output = '<a href="http://pinterest.com/pin/create/button/?'; foreach ($params as $key => $value) { $output .= $key . '=' . urlencode($value) . '&'; } $output = substr($output, 0, -1); //remove last & from the url $output .= '" class="pin-it-button" count-layout="' . strtolower(MODULE_SOCIAL_BOOKMARKS_PINTEREST_BUTTON_COUNT_POSITION) . '"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="' . $this->public_title . '" /></a>'; return $output; }
function getOutput() { global $oscTemplate; $OSCOM_Db = Registry::get('Db'); // add the js in the footer $oscTemplate->addBlock('<script src="//assets.pinterest.com/js/pinit.js"></script>', 'footer_scripts'); $params = array(); // grab the product name (used for description) $params['description'] = tep_get_products_name($_GET['products_id']); // and image (used for media) $Qimage = $OSCOM_Db->get('products', 'products_image', ['products_id' => (int) $_GET['products_id']]); if (!empty($Qimage->value('products_image'))) { $image_file = $Qimage->value('products_image'); $Qimage = $OSCOM_Db->get('products_images', 'image', ['products_id' => (int) $_GET['products_id']], 'sort_order'); if ($Qimage->fetch() !== false) { do { if (!empty($Qimage->value('image'))) { $image_file = $Qimage->value('image'); // overwrite image with first multiple product image break; } } while ($Qimage->fetch()); } $params['media'] = OSCOM::linkImage($image_file); } // url $params['url'] = OSCOM::link('product_info.php', 'products_id=' . $_GET['products_id'], false); $output = '<a href="http://pinterest.com/pin/create/button/?'; foreach ($params as $key => $value) { $output .= $key . '=' . urlencode($value) . '&'; } $output = substr($output, 0, -1); //remove last & from the url $output .= '" class="pin-it-button" count-layout="' . strtolower(MODULE_SOCIAL_BOOKMARKS_PINTEREST_BUTTON_COUNT_POSITION) . '"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="' . $this->public_title . '" /></a>'; return $output; }
function tep_upload_order($order_id, $delimiter = ',', $upload_dir = '') { if (empty($upload_dir)) { $upload_dir = UPLOAD_DIR . 'orders1/'; } // $order_info_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); // if (tep_db_num_rows($order_info_query) < 1) return false; $order_info = tep_db_fetch_array($order_info_query); $insert_id = $order_info['orders_id']; $insert_id = $order_id; $order = new order($insert_id); $shop_info_query = tep_db_query("select shops_url, shops_ssl, shops_prefix, shops_database from " . TABLE_SHOPS . " where shops_id = '" . (int) $order->info['shops_id'] . "'"); $shop_info = tep_db_fetch_array($shop_info_query); $domain_zone = $shop_info['shops_prefix']; $payment_modules = tep_get_payment_modules($order->info['shops_id']); $shipping_modules = tep_get_shipping_modules($order->info['shops_id']); $order_file = $upload_dir . $domain_zone . $insert_id . '.csv'; if (!file_exists($order_file)) { $fp = fopen($order_file, 'w'); $order_history_link = ($order->info['enabled_ssl'] == '1' && tep_not_null($shop_info['shops_ssl']) ? $shop_info['shops_ssl'] : $shop_info['shops_url']) . '/account_history_info.php?order_id=' . $insert_id; $order_total_sum = 0; $order_shipping_sum = 0; $order_discount_sum = 0; reset($order->totals); while (list(, $order_total) = each($order->totals)) { if ($order_total['class'] == 'ot_total') { $order_total_sum = $order_total['value']; } elseif ($order_total['class'] == 'ot_shipping') { $order_shipping_sum = $order_total['value']; $order_shipping_title = $order_total['title']; } elseif (($order_total['class'] == 'ot_discount' || $order_total['class'] == 'ot_custom') && $order_total['value'] < 0) { $order_discount_sum = $order_total['value']; } } $order_payment_id = $order->info['payment_method_class']; if (empty($order_payment_id)) { reset($payment_modules); $payment_found = false; while (list($k, $v) = each($payment_modules)) { if (strpos($v, $order->info['payment_method']) !== false) { $order_payment_id = $k; break; } } if (empty($order_payment_id)) { $order_payment_id = $order->info['payment_method']; } } $order_shipping_id = $order->delivery['delivery_method_class']; if (empty($order_shipping_id)) { reset($shipping_modules); $shipping_found = false; while (list($k, $v) = each($shipping_modules)) { if (strpos($v, $order_shipping_title) !== false) { $order_shipping_id = $k; break; } } if (empty($order_shipping_id)) { $order_shipping_id = $order_shipping_title; } } $self_delivery_id = $order->delivery['delivery_self_address_id']; if (tep_not_null($order->delivery['delivery_self_address']) && (int) $self_delivery_id <= 0) { $shop_info_query = tep_db_query("select shops_database from " . TABLE_SHOPS . " where shops_id = '" . (int) $order->info['shops_id'] . "'"); $shop_info = tep_db_fetch_array($shop_info_query); tep_db_select_db($shop_info['shops_database']); $self_delivery_query = tep_db_query("select self_delivery_id, self_delivery_cost, self_delivery_free, entry_suburb as suburb, entry_city as city, entry_street_address as street_address, entry_telephone as telephone, self_delivery_description from " . TABLE_SELF_DELIVERY . " where 1 order by city, street_address"); while ($self_delivery = tep_db_fetch_array($self_delivery_query)) { $self_delivery_address = tep_address_format($order->delivery['format_id'], $self_delivery, 1, '', ', '); if (strpos($order->delivery['delivery_self_address'], $self_delivery_address) !== false) { $self_delivery_id = $self_delivery['self_delivery_id']; break; } } tep_db_select_db(DB_DATABASE); if ($self_delivery_id == 0) { $self_delivery_id = $order->info['self_delivery']; } } $date_purchased = preg_replace('/(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})/', '$3.$2.$1 $4:$5:$6', $order->info['date_purchased']); $date_purchased = preg_replace('/\\s{2,}/', ' ', $date_purchased); $is_europe = ''; $europe_check_query = tep_db_query("select count(*) as total from setbook_eu." . TABLE_COUNTRIES . " where countries_name like '" . tep_db_input($order->delivery['country']) . "' or countries_ru_name like '" . tep_db_input($order->delivery['country']) . "' or countries_iso_code_2 like '" . tep_db_input($order->delivery['country']) . "' or countries_iso_code_3 like '" . tep_db_input($order->delivery['country']) . "'"); $europe_check = tep_db_fetch_array($europe_check_query); if ($europe_check['total'] > 0) { $is_europe = 'e'; } $order_delivery_country_code = ''; $country_code_info_query = tep_db_query("select countries_iso_code_2 from " . $shop_info['shops_database'] . "." . TABLE_COUNTRIES . " where countries_name = '" . tep_db_input($order->delivery['country']) . "' or countries_ru_name = '" . tep_db_input($order->delivery['country']) . "'"); $country_code_info = tep_db_fetch_array($country_code_info_query); $order_delivery_country_code = $country_code_info['countries_iso_code_2']; if ($order_delivery_country_code == '') { $order_delivery_country = strtolower($order->delivery['country']); $all_countries_file = UPLOAD_DIR . 'csv/all_countries.csv'; $fc = fopen($all_countries_file, 'r'); while ((list($country_name, $country_ru_name, $country_iso_code_2, $country_iso_code_3) = fgetcsv($fc, 40000, ";")) !== FALSE) { $country_name = strtolower($country_name); $country_ru_name = strtolower($country_ru_name); $country_iso_code_3 = strtolower($country_iso_code_3); if ($order_delivery_country == $country_name || $order_delivery_country == $country_ru_name || $order_delivery_country == $country_iso_code_3) { $order_delivery_country_code = $country_iso_code_2; break; } } fclose($fc); } if ($order_delivery_country_code == '') { $fc = fopen($all_countries_file, 'r'); while ((list($country_name, $country_ru_name, $country_iso_code_2, $country_iso_code_3) = fgetcsv($fc, 40000, ";")) !== FALSE) { $country_name = strtolower($country_name); $country_ru_name = strtolower($country_ru_name); if (strpos($country_name, $order_delivery_country) !== false || strpos($country_ru_name, $order_delivery_country) !== false || strpos($country_iso_code_3, $order_delivery_country) !== false) { $order_delivery_country_code = $country_iso_code_2; break; } } fclose($fc); } $common_data = array($insert_id, $date_purchased, $order->info['shops_id'], $order->customer['id'], $order->customer['email_address'], $order->delivery['name'], '', '', $order_payment_id, $order_shipping_id, str_replace(',', '.', $order_shipping_sum), $order->info['currency'], str_replace(',', '.', $order->info['currency_value']), tep_html_entity_decode($order->delivery['state']), tep_html_entity_decode($order->delivery['suburb']), tep_html_entity_decode($order->delivery['city']), $order->delivery['postcode'], tep_html_entity_decode($order->delivery['street_address']), $order->delivery['telephone'], tep_html_entity_decode($order->info['comments']), $self_delivery_id, $order_history_link, str_replace(',', '.', $order_total_sum), str_replace(',', '.', abs($order_discount_sum)), tep_html_entity_decode($order->customer['company']), $order->customer['company_inn'], $order->customer['company_kpp'], $order->customer['company_address_corporate'], $is_europe, $order->info['delivery_transfer_days'], $order->info['code'], $order->delivery['country'], tep_html_entity_decode($order_delivery_country_code), $order->customer['company_corporate']); fputcsvsafe($fp, $common_data, $delimiter); // tep_db_query("update " . TABLE_ORDERS . " set payment_method_class = '" . tep_db_input($order_payment_id) . "', delivery_method_class = '" . tep_db_input($order_shipping_id) . "', delivery_self_address_id = '" . (int)$self_delivery_id . "' where orders_id = '" . (int)$insert_id . "'"); reset($order->products); while (list(, $product) = each($order->products)) { $product_code = (int) str_replace('bbk', '', $product['code']); $common_data = array($product['type'], $product_code, $product['qty'], str_replace(',', '.', $product['final_price']), $product['id'], $product['seller_code'], $product['name'], tep_get_products_name($product['id']), $product['code'], $product['warranty']); fputcsvsafe($fp, $common_data, $delimiter); } fclose($fp); } }
<td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan="7"><?php echo tep_black_line(); ?> </td> </tr> <?php $next_id = 1; $attributes = tep_db_query($attributes); while ($attributes_values = tep_db_fetch_array($attributes)) { $products_name_only = tep_get_products_name($attributes_values['products_id']); $options_name = tep_options_name($attributes_values['options_id']); $values_name = tep_values_name($attributes_values['options_values_id']); $rows++; ?> <tr class="<?php echo floor($rows / 2) == $rows / 2 ? 'attributes-even' : 'attributes-odd'; ?> "> <?php if ($action == 'update_attribute' && $HTTP_GET_VARS['attribute_id'] == $attributes_values['products_attributes_id']) { ?> <td class="smallText"> <?php echo $attributes_values['products_attributes_id']; ?> <input type="hidden" name="attribute_id" value="<?php
Released under the GNU General Public License */ if (defined('MODULE_SHOPBYPRICE_RANGES') && MODULE_SHOPBYPRICE_RANGES > 0) { ?> <!-- shop_by_price eof//--> <div class="well" style="border:3px solid red"> <div class="box-header small-margin-bottom small-margin-left"><?php echo BOX_HEADING_SPECIALS; ?> </div> <?php foreach ($specials->rows as $product_specials22) { $product_specials22_id = $product_specials22['products_id']; $product_specials22_image = tep_get_products_image($product_specials22['products_id']); $product_specials22_name = tep_get_products_name($product_specials22['products_id']); $pf->loadProduct($product_specials22['products_id'], $languages_id); $special_random_price = $pf->getPriceStringShort(); echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price; } ?> </div> <?php } ?> <!-- specials eof//-->
Released under the GNU General Public License */ if (isset($HTTP_GET_VARS['products_id'])) { ?> <!-- notifications //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_NOTIFICATIONS); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')); if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $info_box_contents = array(); if ($notification_exists == true) { $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'); } else { $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'); } new infoBox($info_box_contents); ?> </td> </tr> <!-- notifications_eof //--> <?php }
} elseif (isset($_GET['products_id']) && tep_not_null($_GET['products_id'])) { $products_id = (int) $_GET['products_id']; } if (isset($_GET['products_id']) || isset($_POST['products_id'])) { ?> <!-- notifications //--> <div class="well"> <div class="box-header small-margin-bottom small-margin-left"><?php echo BOX_HEADING_NOTIFICATIONS; ?> </div> <?php if (isset($_SESSION['customer_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $_GET['products_id'] . "' and customers_id = '" . (int) $_SESSION['customer_id'] . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } if ($notification_exists == true) { echo '<div style="text-align:center"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a><br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name((int) $_GET['products_id'])) . '</a></div>'; } else { echo '<div style="text-align:center"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a><br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name((int) $_GET['products_id'])) . '</a></div>'; } ?> </div> <!-- notifications eof//--> <?php }
echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan="5"><?php echo tep_black_line(); ?> </td> </tr> <?php $next_id = 1; $attributes = tep_db_query($attributes); while ($attributes_values = tep_db_fetch_array($attributes)) { $products_name_master = tep_get_products_name($attributes_values['pop_products_id_master']); $products_name_slave = tep_get_products_name($attributes_values['pop_products_id_slave']); if (RELATED_PRODUCTS_ADMIN_USE_MODEL == 'True') { $mModel = tep_get_products_model($attributes_values['pop_products_id_master']) . RELATED_PRODUCTS_ADMIN_MODEL_SEPARATOR . ' '; $sModel = tep_get_products_model($attributes_values['pop_products_id_slave']) . RELATED_PRODUCTS_ADMIN_MODEL_SEPARATOR . ' '; } else { $mModel = $sModel = ''; } $pop_order_id = $attributes_values['pop_order_id']; $rows++; ?> <tr class="<?php echo floor($rows / 2) == $rows / 2 ? 'attributes-even' : 'attributes-odd'; ?> "> <?php if ($action == 'update_attribute' && $HTTP_GET_VARS['pop_id'] == $attributes_values['pop_id']) {
$products_name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $reviews['products_id'] . "' and language_id = '" . (int) $languages_id . "'"); $products_name = tep_db_fetch_array($products_name_query); $reviews_average_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int) $reviews['products_id'] . "'"); $reviews_average = tep_db_fetch_array($reviews_average_query); $review_info = array_merge($reviews_text, $reviews_average, $products_name); $rInfo_array = array_merge($reviews, $review_info, $products_image); $rInfo = new objectInfo($rInfo_array); } if (isset($rInfo) && is_object($rInfo) && $reviews['reviews_id'] == $rInfo->reviews_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . tep_get_products_name($reviews['products_id']); ?> </td> <td class="dataTableContent" align="right"><?php echo tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif'); ?> </td> <td class="dataTableContent" align="right"><?php echo tep_date_short($reviews['date_added']); ?> </td> <td class="dataTableContent" align="right"><?php if (is_object($rInfo) && $reviews['reviews_id'] == $rInfo->reviews_id) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>';
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { echo '<span class="main">' . sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])) . '</span>'; } else { echo '<span class="main">' . sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])) . '</span>'; } if (isset($_SESSION['customer_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $_GET['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } if ($notification_exists == true) { echo '<br><span class="main"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name((int) $_GET['products_id'])) . '</a></span><br>'; } else { echo '<br><span class="main"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name((int) $_GET['products_id'])) . '</a></span><br>'; } echo '<span class="main"><a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . (int) $_GET['products_id'], 'NONSSL') . '">' . BOX_TELL_A_FRIEND_TEXT . '</a></span><br>'; ?> </div> <!-- Tab 6 eof --> <?php //automoate loading tab files $tab_id = ''; $tab_title = ''; for ($i = 0; $i < sizeof($tab_file_array); $i++) { $file = $tab_file_array[$i]; $tab_id = str_replace('.php', '', $file);
$modelsObj->pid = $product['products_id']; $modelsObj->products_name = $product['products_name']; $modelsObj->render(NULL); $imgs = array(); foreach ($modelsObj->getImages() as $img) { $imgs[$img] = tep_image_src($img, $img_wd, $img_ht); } list($img0) = $imgs; echo tep_image($img0, $products['products_name'], $img_wd, $img_ht, 'id="add_product_image"'); echo '<div style="padding:10px 0 0 0">'; $att = tep_block('blk_attr_select_pulldn'); $att->setContext(array('models' => $modelsObj), array()); $att->render(array()); $addr = new IXaddress(array('country' => $_REQUEST['country'], 'state' => $_REQUEST['state'])); echo tep_draw_hidden_field('add_product_id', $add_product_id, ' id="add_product_id"'); echo tep_draw_hidden_field('add_product_name', tep_get_products_name($add_product_id), ' id="add_product_name"'); echo tep_draw_hidden_field('add_product_model', $product['products_model'], ' id="add_product_model"'); echo tep_draw_hidden_field('add_product_cost', $product['products_price'], ' id="add_product_cost"'); echo tep_draw_hidden_field('add_product_comments', '', ' id="add_product_comments"'); echo tep_draw_hidden_field('add_product_tax_class', $product['products_tax_class_id'], ' id="add_product_tax_class"'); echo tep_draw_hidden_field('add_product_tax', tep_get_tax_rate($product['products_tax_class_id'], $addr->getCountryID(), $addr->getZoneID()), ' id="add_product_tax"'); echo tep_draw_hidden_field('add_product_weight', $product['products_weight'], ' id="add_product_weight"'); echo tep_draw_hidden_field('add_product_attrs', '', ' id="add_product_attrs"'); ?> <span style="font:normal 11px arial">Qty:</span> <?php echo tep_draw_input_field('add_product_quantity', 1, ' id="add_product_quantity" size="1" style="text-align:center"'); ?> <span><button id="add_product_button" name="new_product_add" onclick="AddToSupplyRequest({id:jQuery('#add_product_id').val(), name:jQuery('#add_product_name').val(), model:jQuery('#add_product_model').val(), cost:jQuery('#add_product_cost').val(), comments:jQuery('#add_product_comments').val(), tax:jQuery('#add_product_tax').val(), tax_class:jQuery('#add_product_tax_class').val(),weight:jQuery('#add_product_weight').val()},jQuery('#add_product_quantity').val(),getNewProdAttrs()); return false;">Add</button></span> </div> <script type="text/javascript">
break; default: if ($rows > 0) { if (isset($cInfo) && is_object($cInfo)) { // category info box contents $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added)); if (tep_not_null($cInfo->last_modified)) { $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified)); } $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image); $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count); } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added)); if (tep_not_null($pInfo->products_last_modified)) { $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified)); } if (date('Y-m-d') < $pInfo->products_date_available) { $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available)); } $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image); $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity); $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%'); } } else { // create category/product info $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
Released under the GNU General Public License */ if ($_GET['products_id']) { $xsell_query = tep_db_query("select distinct ax.articles_id, ad.articles_name, a.articles_last_modified from " . TABLE_ARTICLES_XSELL . " ax LEFT JOIN " . TABLE_ARTICLES . " a USING(articles_id) LEFT JOIN " . TABLE_ARTICLES_DESCRIPTION . " ad USING(articles_id) where ax.xsell_id = '" . (int) $_GET['products_id'] . "' and ad.language_id = '" . (int) $languages_id . "' and a.articles_status = '1' order by a.articles_last_modified"); $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell >= MIN_DISPLAY_ARTICLES_XSELL) { ?> <!-- xsell_articles //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_PXSELL_ARTICLES); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { $xsell['products_name'] = tep_get_products_name($xsell['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => tep_image(DIR_WS_IMAGES . 'icons/article.gif', $xsell['articles_name']) . ' <a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $xsell['articles_id']) . '">' . $xsell['articles_name'] . '</a><br>'); $col++; if ($col > 1) { $col = 0; $row++; } } new contentBox($info_box_contents); ?> <!-- xsell_articles_eof //--> <?php } }
$Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { ?> <!-- whats_new //--> <tr> <td> <?php $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW)); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price); new infoBox($info_box_contents); ?> </td>
<!-- notifications //--> <?php $boxHeading = BOX_HEADING_NOTIFICATIONS; $corner_top_left = 'rounded'; $corner_top_right = 'rounded'; $corner_bottom_left = 'rounded'; $corner_bottom_right = 'rounded'; $boxContent_attributes = ''; $boxLink = '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . tep_image(bts_select('images', 'infobox/arrow_right.png'), ICON_ARROW_RIGHT) . '</a>'; $box_base_name = 'product_notifications'; // for easy unique box template setup (added BTSv1.2) $box_id = $box_base_name . 'Box'; // for CSS styling paulm (editted BTSv1.2) if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $_GET['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } if ($notification_exists == true) { $boxContent = '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><center><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(bts_select('icons', 'notifications_del.png'), IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></center></td></tr><tr><td class="infoBoxContents"><center><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($_GET['products_id'])) . '</a></center></td></tr></table>'; } else { $boxContent = '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><center><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(bts_select('icons', 'notifications.png'), IMAGE_BUTTON_NOTIFICATIONS) . '</a></center></td></tr><tr><td class="infoBoxContents"><center><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($_GET['products_id'])) . '</a></center></td></tr></table>'; } include bts_select('boxes', $box_base_name); // BTS 1.5 $boxLink = ''; } } }
$OSCOM_Db->save('products_notifications', ['products_id' => $notify[$i], 'customers_id' => $_SESSION['customer_id'], 'date_added' => 'now()']); $messageStack->add_session('product_action', sprintf(PRODUCT_SUBSCRIBED, tep_get_products_name((int) $notify[$i])), 'success'); } } OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action', 'notify'))); } else { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php', '', 'SSL'); } break; case 'notify_remove': if (isset($_SESSION['customer_id']) && isset($_GET['products_id'])) { $Qcheck = $OSCOM_Db->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); if ($Qcheck->fetch() !== false) { $OSCOM_Db->delete('products_notifications', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); $messageStack->add_session('product_action', sprintf(PRODUCT_UNSUBSCRIBED, tep_get_products_name((int) $_GET['products_id'])), 'warning'); } OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action'))); } else { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php', '', 'SSL'); } break; case 'cust_order': if (isset($_SESSION['customer_id']) && isset($_GET['pid'])) { if (tep_has_product_attributes($_GET['pid'])) { OSCOM::redirect('product_info.php', 'products_id=' . $_GET['pid']); } else { $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1); } }
<?php if (isset($HTTP_GET_VARS['products_id'])) { $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int) $HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { $counter = 0; $col = 0; $also_pur_prods_content = '<ul class="row productSlider">'; while ($orders = tep_db_fetch_array($orders_query)) { $counter++; $orders['products_name'] = tep_get_products_name($orders['products_id']); $also_pur_prods_content .= '<li class="col-xs-3"><div class="product-container">'; $also_pur_prods_content .= '<div class="product-image-box">' . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], ALSOPURCHASED_IMAGE_WIDTH, ALSOPURCHASED_IMAGE_HEIGHT, '', '') . '</a>' . '</div>' . ' <a class="product-name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>'; $col++; $also_pur_prods_content .= '</div></li>'; } $also_pur_prods_content .= '</ul>'; $also_pur_prods_content .= ' <script type="text/jscript"> $(".productSlider").bxSlider({ minSlides: 4, maxSlides: 4, slideWidth: 202, slideMargin: 20, moveSlides: 1, pager: false, infiniteLoop: false, hideControlOnEnd: true, responsive:false, controls:true,
while ($Qreviews->fetch()) { if ((!isset($_GET['rID']) || isset($_GET['rID']) && (int) $_GET['rID'] === $Qreviews->valueInt('reviews_id')) && !isset($rInfo)) { $Qextra = $OSCOM_Db->get(['reviews r', 'reviews_description rd'], ['r.reviews_read', 'r.customers_name', 'length(rd.reviews_text) as reviews_text_size'], ['r.reviews_id' => ['val' => $Qreviews->valueInt('reviews_id'), 'ref' => 'rd.reviews_id']]); $Qproducts = $OSCOM_Db->get(['products p', 'products_description pd'], ['pd.products_name', 'p.products_image'], ['p.products_id' => ['val' => $Qreviews->valueInt('products_id'), 'ref' => 'pd.products_id'], 'pd.language_id' => $OSCOM_Language->getId()]); $Qaverage = $OSCOM_Db->get('reviews', ['(avg(reviews_rating) / 5 * 100) as average_rating'], ['products_id' => $Qreviews->valueInt('products_id')]); $rInfo_array = array_merge($Qreviews->toArray(), $Qextra->toArray(), $Qproducts->toArray(), $Qaverage->toArray()); $rInfo = new objectInfo($rInfo_array); } if (isset($rInfo) && is_object($rInfo) && $Qreviews->valueInt('reviews_id') === (int) $rInfo->reviews_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . OSCOM::link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . OSCOM::link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $Qreviews->valueInt('reviews_id')) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . OSCOM::link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $Qreviews->valueInt('reviews_id') . '&action=preview') . '">' . HTML::image(OSCOM::linkImage('icons/preview.gif'), OSCOM::getDef('icon_preview')) . '</a> ' . tep_get_products_name($Qreviews->valueInt('products_id')); ?> </td> <td class="dataTableContent" align="right"><?php echo HTML::image(OSCOM::linkImage('Shop/stars_' . $Qreviews->valueInt('reviews_rating') . '.gif')); ?> </td> <td class="dataTableContent" align="right"><?php echo DateTime::toShort($Qreviews->value('date_added')); ?> </td> <td class="dataTableContent" align="center"> <?php if ($Qreviews->valueInt('reviews_status') === 1) { echo HTML::image(OSCOM::linkImage('icon_status_green.gif'), OSCOM::getDef('image_icon_status_green'), 10, 10) . ' <a href="' . OSCOM::link(FILENAME_REVIEWS, 'action=setflag&flag=0&rID=' . $Qreviews->valueInt('reviews_id') . '&page=' . $_GET['page']) . '">' . HTML::image(OSCOM::linkImage('icon_status_red_light.gif'), OSCOM::getDef('image_icon_status_red_light'), 10, 10) . '</a>'; } else {
Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- new_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))); new contentBoxHeading($info_box_contents); if (!isset($new_products_category_id) || $new_products_category_id == '0') { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int) $new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']))); $col++; if ($col > 2) { $col = 0; $row++; } } new contentBox($info_box_contents); ?> <!-- new_products_eof //-->