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 $PHP_SELF, $oscTemplate, $product_check, $languages_id, $currency; if ($product_check['total'] > 0) { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from products p, products_description pd where p.products_id = '" . (int) $_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'"); if (tep_db_num_rows($product_info_query) === 1) { $product_info = tep_db_fetch_array($product_info_query); $data = array('og:type' => 'product', 'og:title' => $product_info['products_name'], 'og:site_name' => STORE_NAME); $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197) . '...'; $data['og:description'] = $product_description; $products_image = $product_info['products_image']; $pi_query = tep_db_query("select image from products_images where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1"); if (tep_db_num_rows($pi_query) === 1) { $pi = tep_db_fetch_array($pi_query); $products_image = $pi['image']; } $data['og:image'] = tep_href_link('images/' . $products_image, '', 'NONSSL', false, false); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = $this->format_raw($new_price); } else { $products_price = $this->format_raw($product_info['products_price']); } $data['product:price:amount'] = $products_price; $data['product:price:currency'] = $currency; $data['og:url'] = tep_href_link('product_info.php', 'products_id=' . $product_info['products_id'], 'NONSSL', false); $data['product:availability'] = $product_info['products_quantity'] > 0 ? MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_TEXT_IN_STOCK : MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_TEXT_OUT_OF_STOCK; $result = ''; foreach ($data as $key => $value) { $result .= '<meta property="' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . PHP_EOL; } $oscTemplate->addBlock($result, $this->group); } } }
function execute() { global $PHP_SELF, $HTTP_GET_VARS, $oscTemplate, $languages_id, $currencies, $currency, $product_check; if ($PHP_SELF == FILENAME_PRODUCT_INFO && isset($HTTP_GET_VARS['products_id'])) { if ($product_check['total'] > 0) { $product_info_query = tep_db_query("select p.products_id, COALESCE(NULLIF(pd.products_seo_title, ''), pd.products_name) as products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'"); if (tep_db_num_rows($product_info_query) === 1) { $product_info = tep_db_fetch_array($product_info_query); $data = array('card' => 'product', 'title' => $product_info['products_name']); if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID)) { $data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID; } if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID)) { $data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID; } $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197); if (strlen($product_description) == 197) { $product_description .= ' ..'; } $data['description'] = $product_description; $products_image = $product_info['products_image']; $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1"); if (tep_db_num_rows($pi_query) === 1) { $pi = tep_db_fetch_array($pi_query); $products_image = $pi['image']; } $data['image:src'] = tep_href_link(DIR_WS_IMAGES . $products_image, '', 'NONSSL', false, false); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])); } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } $data['data1'] = $products_price; $data['label1'] = $currency; if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_PRE_ORDER; $data['label2'] = tep_date_short($product_info['products_date_available']); } elseif ($product_info['products_quantity'] > 0) { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_IN_STOCK; $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_BUY_NOW; } else { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_OUT_OF_STOCK; $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_CONTACT_US; } $result = ''; foreach ($data as $key => $value) { $result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n"; } $oscTemplate->addBlock($result, $this->group); } } } }
function execute() { global $PHP_SELF, $oscTemplate; $OSCOM_Db = Registry::get('Db'); $OSCOM_Language = Registry::get('Language'); if (basename($PHP_SELF) == 'product_info.php') { $Qproduct = $OSCOM_Db->prepare('select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from :table_products p, :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id'); $Qproduct->bindInt(':products_id', $_GET['products_id']); $Qproduct->bindInt(':language_id', $OSCOM_Language->getId()); $Qproduct->execute(); if ($Qproduct->fetch() !== false) { $data = array('og:type' => 'product', 'og:title' => $Qproduct->value('products_name'), 'og:site_name' => STORE_NAME); $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($Qproduct->value('products_description')))), 0, 197) . '...'; $data['og:description'] = $product_description; $products_image = $Qproduct->value('products_image'); $Qimage = $OSCOM_Db->get('products_images', 'image', ['products_id' => $Qproduct->valueInt('products_id')], 'sort_order', 1); if ($Qimage->fetch() !== false) { $products_image = $Qimage->value('image'); } $data['og:image'] = OSCOM::linkImage($products_image); if ($new_price = tep_get_products_special_price($Qproduct->valueInt('products_id'))) { $products_price = $this->format_raw($new_price); } else { $products_price = $this->format_raw($Qproduct->value('products_price')); } $data['product:price:amount'] = $products_price; $data['product:price:currency'] = $_SESSION['currency']; $data['og:url'] = OSCOM::link('product_info.php', 'products_id=' . $Qproduct->valueInt('products_id'), false); $data['product:availability'] = $Qproduct->valueInt('products_quantity') > 0 ? OSCOM::getDef('module_header_tags_product_opengraph_text_in_stock') : OSCOM::getDef('module_header_tags_product_opengraph_text_out_of_stock'); $result = ''; foreach ($data as $key => $value) { $result .= '<meta property="' . HTML::outputProtected($key) . '" content="' . HTML::outputProtected($value) . '" />' . PHP_EOL; } $oscTemplate->addBlock($result, $this->group); } } }
function execute() { global $PHP_SELF, $oscTemplate, $currencies; $OSCOM_Db = Registry::get('Db'); if ($PHP_SELF == 'product_info.php' && isset($_GET['products_id'])) { $Qproduct = $OSCOM_Db->prepare('select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from :table_products p, :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id'); $Qproduct->bindInt(':products_id', $_GET['products_id']); $Qproduct->bindInt(':language_id', $_SESSION['languages_id']); $Qproduct->execute(); if ($Qproduct->fetch() !== false) { $data = array('card' => 'product', 'title' => $Qproduct->value('products_name')); if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID)) { $data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID; } if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID)) { $data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID; } $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($Qproduct->value('products_description')))), 0, 197); if (strlen($product_description) == 197) { $product_description .= ' ..'; } $data['description'] = $product_description; $products_image = $Qproduct->value('products_image'); $Qimage = $OSCOM_Db->get('products_images', 'image', ['products_id' => $Qproduct->valueInt('products_id')], 'sort_order', 1); if ($Qimage->fetch() !== false) { $products_image = $Qimage->value('image'); } $data['image:src'] = OSCOM::link(DIR_WS_IMAGES . $products_image, '', 'NONSSL', false, false); if ($new_price = tep_get_products_special_price($Qproduct->valueInt('products_id'))) { $products_price = $currencies->display_price($new_price, tep_get_tax_rate($Qproduct->valueInt('products_tax_class_id'))); } else { $products_price = $currencies->display_price($Qproduct->value('products_price'), tep_get_tax_rate($Qproduct->valueInt('products_tax_class_id'))); } $data['data1'] = $products_price; $data['label1'] = $_SESSION['currency']; if ($Qproduct->value('products_date_available') > date('Y-m-d H:i:s')) { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_PRE_ORDER; $data['label2'] = tep_date_short($Qproduct->value('products_date_available')); } elseif ($Qproduct->valueInt('products_quantity') > 0) { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_IN_STOCK; $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_BUY_NOW; } else { $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_OUT_OF_STOCK; $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_CONTACT_US; } $result = ''; foreach ($data as $key => $value) { $result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n"; } $oscTemplate->addBlock($result, $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 $PHP_SELF, $HTTP_GET_VARS, $oscTemplate, $languages_id, $currencies, $currency, $product_check; if ($PHP_SELF == FILENAME_PRODUCT_INFO && isset($HTTP_GET_VARS['products_id'])) { if ($product_check['total'] > 0) { $product_info_query = tep_db_query("select p.products_id, COALESCE(NULLIF(pd.products_seo_title, ''), pd.products_name) as products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'"); if (tep_db_num_rows($product_info_query) === 1) { $product_info = tep_db_fetch_array($product_info_query); $data = array('og:type' => 'product', 'og:title' => $product_info['products_name'], 'og:site_name' => STORE_NAME); if (tep_not_null(MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_APP_ID)) { $data['fb:app_id'] = MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_APP_ID; } $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197); if (strlen($product_description) == 197) { $product_description .= ' ..'; } $data['og:description'] = $product_description; $products_image = $product_info['products_image']; $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1"); if (tep_db_num_rows($pi_query) === 1) { $pi = tep_db_fetch_array($pi_query); $products_image = $pi['image']; } $data['og:image'] = tep_href_link(DIR_WS_IMAGES . $products_image, '', 'NONSSL', false, false); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = $this->format_raw($new_price); } else { $products_price = $this->format_raw($product_info['products_price']); } $data['product:price:amount'] = $products_price; $data['product:price:currency'] = $currency; $data['og:url'] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL', false); $data['product:availability'] = $product_info['products_quantity'] > 0 ? MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_TEXT_IN_STOCK : MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_TEXT_OUT_OF_STOCK; $result = ''; foreach ($data as $key => $value) { $result .= '<meta property="' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n"; } $oscTemplate->addBlock($result, $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); } }
//$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $_GET['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_ALSO_PURCHASED); } // EOF Separate Pricing Per Customer $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell > 0) { ?> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { $xsell['specials_new_products_price'] = tep_get_products_special_price($xsell['products_id']); if ($xsell['specials_new_products_price']) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } //Cache $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a><br>' . $xsell_price . '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) . '</a>'; //Fin cache $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text); //Modifié Cache //Cache $cache .= '$info_box_contents[' . $row . '][' . $col . '] = array(\'align\' => \'center\', \'params\' => \'class="smallText" width="33%" valign="top"\', \'text\' => \'' . str_replace("'", "\\'", $text) . '\');';
$error = true; $messageStack->add('review', JS_REVIEW_TEXT); } if ($rating < 1 || $rating > 5) { $error = true; $messageStack->add('review', JS_REVIEW_RATING); } if ($error == false) { $OSCOM_Db->save('reviews', ['products_id' => $Qcheck->valueInt('products_id'), 'customers_id' => $_SESSION['customer_id'], 'customers_name' => $Qcustomer->value('customers_firstname') . ' ' . $Qcustomer->value('customers_lastname'), 'reviews_rating' => $rating, 'date_added' => 'now()']); $insert_id = $OSCOM_Db->lastInsertId(); $OSCOM_Db->save('reviews_description', ['reviews_id' => $insert_id, 'languages_id' => $_SESSION['languages_id'], 'reviews_text' => $review]); $messageStack->add_session('product_reviews', TEXT_REVIEW_RECEIVED, 'success'); OSCOM::redirect('product_reviews.php', tep_get_all_get_params(array('action'))); } } if ($new_price = tep_get_products_special_price($Qcheck->valueInt('products_id'))) { $products_price = '<del>' . $currencies->display_price($Qcheck->valueDecimal('products_price'), tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))) . '</span>'; } else { $products_price = $currencies->display_price($Qcheck->valueDecimal('products_price'), tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))); } $products_name = $Qcheck->value('products_name'); if (!empty($Qcheck->value('products_model'))) { $products_name .= ' <small>[' . $Qcheck->value('products_model') . ']</small>'; } $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('product_reviews.php', tep_get_all_get_params())); require 'includes/template_top.php'; ?> <div class="page-header"> <div class="row"> <h1 class="col-sm-8"><?php
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> </tr>
$review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int) $_GET['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'"); $review = tep_db_fetch_array($review_query); // BOF: MOD - Separate Pricing Per Customer if (!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } if ($customer_group_id != '0') { $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $review['products_id'] . "' and customers_group_id = '" . $customer_group_id . "' and customers_group_price != null"); if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) { $review['products_price'] = $customer_group_price['customers_group_price']; } } // EOF: MOD - Separate Pricing Per Customer if ($new_price = tep_get_products_special_price($review['products_id'])) { $products_price = '<span style="text-decoration:line-through">' . $currencies->display_price($review['products_price'], tep_get_tax_rate($review['products_tax_class_id'])) . '</span> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($review['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($review['products_price'], tep_get_tax_rate($review['products_tax_class_id'])); } if (tep_not_null($review['products_model'])) { $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>'; } else { $products_name = $review['products_name']; } require bts_select('language', FILENAME_PRODUCT_REVIEWS_INFO); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); $content = CONTENT_PRODUCT_REVIEWS_INFO; $javascript = 'popup_window.js'; include bts_select('main'); // BTSv1.5
$products_price .= '<span class="specialprice">'; $products_price .= $currencies->display_price($new_price, tep_get_tax_rate($random_product['products_tax_class_id'])); $products_price .= '</span>'; } else { $products_price = '<span class="oldprice">'; $products_price .= $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); $products_price .= '</span> '; $products_price .= '<span class="specialprice">'; $products_price .= $currencies->display_price($discount_price['lowest']['price'], tep_get_tax_rate($random_product['products_tax_class_id'])); $products_price .= '</span>'; } } else { $products_price = '<span class="oldprice">'; $products_price .= $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); $products_price .= '</span> '; $products_price .= '<span class="specialprice">'; $products_price .= $currencies->display_price($discount_price['lowest']['price'], tep_get_tax_rate($random_product['products_tax_class_id'])); $products_price .= '</span>'; } } else { if ($new_price = tep_get_products_special_price($random_product['products_id'])) { $products_price = '<span class="oldprice">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span> <span class="specialprice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = '<span class="yourprice">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } } if (CanShop() == 'true') { echo $products_price; } echo '</div>'; }
$count = 0; ?> <div class="module related-product"> <h3 class="module-heading"><?php echo TEXT_RELATED_PRODUCTS; ?> </h3> <div class="block-content"> <ul class="row productSlider"> <?php while ($attributes_values = tep_db_fetch_array($attribute_query)) { $products_name_slave = $attributes_values['products_name']; $products_model_slave = $attributes_values['products_model']; $products_qty_slave = $attributes_values['products_quantity']; $products_id_slave = $attributes_values['pop_products_id_slave']; if ($new_price = tep_get_products_special_price($products_id_slave)) { $products_price_slave = $currencies->display_price($new_price, tep_get_tax_rate($attributes_values['products_tax_class_id'])); } else { $products_price_slave = $currencies->display_price($attributes_values['products_price'], tep_get_tax_rate($attributes_values['products_tax_class_id'])); } echo '<li class="col-xs-3"><div class="product-container">'; // show thumb image if Enabled if (RELATED_PRODUCTS_SHOW_THUMBS == 'True') { echo ' <div class="product-image-box">' . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . tep_image(DIR_WS_IMAGES . $attributes_values['products_image'], $attributes_values['products_name'], ALSOPURCHASED_IMAGE_WIDTH, ALSOPURCHASED_IMAGE_HEIGHT, '') . '</a>' . ' </div>'; } $caption = ''; if (RELATED_PRODUCTS_SHOW_NAME == 'True') { $caption .= '<div class="related-row product-name-box">' . '<a class="product-name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . $products_name_slave; if (RELATED_PRODUCTS_SHOW_MODEL == 'True') { $caption .= sprintf(RELATED_PRODUCTS_MODEL_COMBO, $products_model_slave); }
function get_products() { global $languages_id; // BOF Separate Pricing Per Customer // global variable (session) $sppc_customer_group_id -> class variable cg_id global $sppc_customer_group_id; if (!tep_session_is_registered('sppc_customer_group_id')) { $this->cg_id = '0'; } else { $this->cg_id = $sppc_customer_group_id; } // EOF Separate Pricing Per Customer if (!is_array($this->contents)) { return false; } $products_array = array(); reset($this->contents); while (list($products_id, ) = each($this->contents)) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'"); if ($products = tep_db_fetch_array($products_query)) { $prid = $products['products_id']; $products_price = $products['products_price']; // BOF Separate Pricing Per Customer /* $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'"); if (tep_db_num_rows($specials_query)) { $specials = tep_db_fetch_array($specials_query); $products_price = $specials['specials_new_products_price']; } */ $specials_price = tep_get_products_special_price($prid); if (tep_not_null($specials_price)) { $products_price = $specials_price; } elseif ($this->cg_id != 0) { $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int) $prid . "' and customers_group_id = '" . $this->cg_id . "'"); if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) { $products_price = $customer_group_price['customers_group_price']; } } // EOF Separate Pricing Per Customer $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], 'final_price' => $products_price + $this->attributes_price($products_id), 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''); } } return $products_array; }
} if (date('Y-m-d') < $pInfo->products_date_available) { $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available)); } // BOF: MoPics in Admin $contents[] = array('text' => TEXT_THUMBNAIL_IMAGE . '<br /><br /><center><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $image_subdirectory . $pInfo->products_image . '" width="' . SMALL_IMAGE_WIDTH . '" /></center>'); // EOF: MoPics in Admin // BOF: MSRP if ($pInfo->products_msrp > $pInfo->products_price) { if ($new_price = tep_get_products_special_price($pInfo->products_id)) { $products_price = '<span class="oldPrice">' . $currencies->format($pInfo->products_msrp) . '</span> <span class="listPrice">' . $currencies->format($pInfo->products_price) . '</span> <span class="specialPrice">' . $currencies->format($new_price) . '</span>'; } else { $products_price = '<span class="oldPrice">' . $currencies->format($pInfo->products_msrp) . '</span> ' . $currencies->format($pInfo->products_price); } } else { if ($new_price = tep_get_products_special_price($pInfo->products_id)) { $products_price = '<span class="oldPrice">' . $currencies->format($pInfo->products_price) . '</span> <span class="specialPrice">' . $currencies->format($new_price) . '</span>'; } else { $products_price = $currencies->format($pInfo->products_price); } } // EOF: MSRP $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $products_price . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity); $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%'); //BOF QPBPP for SPPC v4.2 $retail_price = $pInfo->products_price; unset($pInfo->products_price); $pInfo->products_price[0] = $retail_price; $retail_products_qty_blocks = $pInfo->products_qty_blocks; unset($pInfo->products_qty_blocks); $pInfo->products_qty_blocks[0] = $retail_products_qty_blocks;
</div> <div class="col-xs-6"><?php echo $tags_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))) . '<span class="resultText">' . TEXT_RESULT_PAGE . '</span>'; ?> </div> </div> </div> <?php } ?> <ul class="row product-listing"> <?php $row = 0; $tags_query = tep_db_query($tags_split->sql_query); while ($tags = tep_db_fetch_array($tags_query)) { if ($new_price = tep_get_products_special_price($tags['products_id'])) { $products_price = $currencies->display_price($tags['products_price'], tep_get_tax_rate($tags['products_tax_class_id'])); $products_price_new = $currencies->display_price($new_price, tep_get_tax_rate($tags['products_tax_class_id'])); } else { $products_price = $currencies->display_price($tags['products_price'], tep_get_tax_rate($tags['products_tax_class_id'])); $products_price_new = ''; } $tags_content .= tep_product_block_build($productId = $tags['products_id'], $productImage = $tags['products_image'], $productName = $tags['products_name'], $productAdded = '', $productManufacturerId = '', $productManufacturerName = '', $productPrice = $products_price, $productPriceNew = $products_price_new, $productWeight = '', $productQuantity = '', $productModel = '', $productDescription = '', $productButtons = true, $pageComming = FILENAME_PRODUCT_INFO, $elCount = $i); } echo $tags_content; ?> </ul> <?php if ($tags_split->number_of_rows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) { ?> <div class="listing-panel bottom-panel">
if (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES == 'true' && !empty($current_category_id)) { /// We are in category depth $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and c.categories_featured = '1' and cd.language_id = '" . (int) $languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and (" . $categories_query_addition . ") and pd.language_id = '" . (int) $languages_id . "' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES; } else { if (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES == 'true' && tep_not_null(isset($product_info['products_id']))) { // products info page $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and c.categories_featured = '1' and cd.language_id = '" . (int) $languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and p2c.categories_id = '" . (int) $featured_product_category_id . "' and pd.language_id = '" . (int) $languages_id . "' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES; } else { // default $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and c.categories_featured = '1' and cd.language_id = '" . (int) $languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int) $languages_id . "' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES; } } $featured_categories_query = tep_db_query($featured_categories_query_raw); while ($featured_categories = tep_db_fetch_array($featured_categories_query)) { // Set special price only for specific groups $featured_categories['specials_new_products_price'] = tep_get_products_special_price($featured_categories['products_id']); $featured_categories_array[] = array('cid' => $featured_categories['categories_id'], 'cname' => $featured_categories['categories_name'], 'cimage' => $featured_categories['categories_image'], 'pid' => $featured_categories['products_id'], 'pname' => $featured_categories['products_name'], 'pmodel' => $featured_categories['products_model'], 'pdescription' => $featured_categories['products_description'], 'pshortdescription' => $featured_categories['products_short'], 'pimage' => $featured_categories['products_image'], 'pprice' => $featured_categories['products_price'], 'pspecials_price' => $featured_categories['specials_new_products_price'], 'ptax_class_id' => $featured_categories['products_tax_class_id']); } echo '<!-- Featured_Sets_bof //-->' . "\n"; echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">' . "\n"; echo ' <tr>' . "\n"; echo ' <td>' . "\n"; if (FEATURED_PRODUCTS_DISPLAY == 'true' && FEATURED_PRODUCTS_POSITION == '1') { include DIR_WS_MODULES . (FEATURED_PRODUCTS_GROUPING == 'sbox' ? FILENAME_FEATURED_SBOX_PRODUCTS : FILENAME_FEATURED_GBOX_PRODUCTS); } else { if (FEATURED_MANUFACTURERS_DISPLAY == 'true' && FEATURED_MANUFACTURERS_POSITION == '1') { include DIR_WS_MODULES . FILENAME_FEATURED_MANUFACTURERS; } else { if (FEATURED_MANUFACTURER_DISPLAY == 'true' && FEATURED_MANUFACTURER_POSITION == '1') { include DIR_WS_MODULES . (FEATURED_MANUFACTURER_GROUPING == 'sbox' ? FILENAME_FEATURED_SBOX_MANUFACTURER : FILENAME_FEATURED_GBOX_MANUFACTURER); } else {
// got a matched cart, skip to next one } $sentInfo = TEXT_NOT_CONTACTED; if ($sentdate != '') { $sentInfo = cart_date_short($sentdate); } $cline = "\n\t\t\t\t<tr bgcolor=" . $fcolor . ">\n\t\t\t\t <td class='dataTableContent' align='center' width='1%'>" . tep_draw_checkbox_field('custid[]', $curcus, RCS_AUTO_CHECK == 'true' ? $checked : 0) . "</td>\n\t\t\t\t <td class='dataTableContent' align='left' width='9%' nowrap><b>" . $sentInfo . "</b></td>\n\t\t\t\t <td class='dataTableContent' align='left' width='15%' nowrap> " . cart_date_short($inrec['bdate']) . "</td>\n\t\t\t\t <td class='dataTableContent' align='left' width='30%' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $customer . "</a>" . $status . "</td>\n\t\t\t\t <td class='dataTableContent' align='left' colspan='2' width='30%' nowrap><a href='" . tep_href_link('mail.php', 'selected_box=tools&customer=' . $inrec['email']) . "'>" . $inrec['email'] . "</a></td>\n\t\t\t\t <td class='dataTableContent' align='left' colspan='1' width='15%' nowrap>" . $inrec['phone'] . "</td>\n\t\t\t\t <td><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $curcus . "&tdate=" . $tdate . "&sdate=" . $sdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td>\n\t\t\t\t</tr>"; } } // We only have something to do for the product if the quantity selected was not zero! if ($inrec['qty'] != 0) { // Get the product information (name, price, etc) $query2 = tep_db_query("select p.products_price price,\n\t\t\t\t\t\t\t\t\t\t\t\t\tp.products_tax_class_id taxclass,\n\t\t\t\t\t\t\t\t\t\t\t\t\tp.products_model model,\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.products_name name\n\t\t\t\t\t\t\t\t\t\t from " . TABLE_PRODUCTS . " p,\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . TABLE_PRODUCTS_DESCRIPTION . " pd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . TABLE_LANGUAGES . " l\n\t\t\t\t\t\t\t\t\t\t where p.products_id = '" . (int) $inrec['pid'] . "' and\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.products_id = p.products_id and\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.language_id = " . (int) $languages_id); $inrec2 = tep_db_fetch_array($query2); // Check to see if the product is on special, and if so use that pricing $sprice = tep_get_products_special_price($inrec['pid']); if ($sprice < 1) { $sprice = $inrec2['price']; } // Some users may want to include taxes in the pricing, allow that. NOTE HOWEVER that we don't have a good way to get individual tax rates based on customer location yet! if (RCS_INCLUDE_TAX_IN_PRICES == 'true') { $sprice += $sprice * tep_get_tax_rate($inrec2['taxclass']) / 100; } else { if (RCS_USE_FIXED_TAX_IN_PRICES == 'true' && RCS_FIXED_TAX_RATE > 0) { $sprice += $sprice * RCS_FIXED_TAX_RATE / 100; } } // BEGIN OF ATTRIBUTE DB CODE $prodAttribs = ''; // DO NOT DELETE if (RCS_SHOW_ATTRIBUTES == 'true') {
function adwords_tag() { $this->installer = new adwords_tag_install(); $scriptname = ltrim(basename($_SERVER['SCRIPT_NAME'])); $return = array(); switch ($scriptname) { case FILENAME_DEFAULT: global $category_depth; if ($category_depth == 'top') { $this->page_type = 'home'; } else { $this->page_type = 'category'; } $this->page_products_id = "''"; break; case FILENAME_PRODUCT_INFO: global $_GET, $currency, $currencies; if (tep_not_null($_GET['products_id'])) { $this->page_products_id = "'" . $_GET['products_id'] . "'"; global $product_info; $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; $this->page_totalvalue = number_format(tep_add_tax($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) * $rate, $decimal_places); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $this->page_totalvalue = number_format(tep_add_tax($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])), $decimal_places); } } else { $this->page_products_id = "''"; } $this->page_type = 'product'; break; case FILENAME_SHOPPING_CART: global $cart, $currency, $currencies; if ($cart && is_object($cart)) { $products_id_list = array(); foreach ($cart->contents as $products_id => $products_content) { $products_id_list[] = "'" . (int) $products_id . "'"; } if (count($products_id_list) <= 0) { $this->page_products_id = "''"; } elseif (count($products_id_list) == 1) { $this->page_products_id = $products_id_list[0]; } else { $this->page_products_id = '[' . implode(',', $products_id_list) . ']'; } $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; $this->page_totalvalue = number_format($cart->show_total() * $rate, $decimal_places); } else { $this->page_products_id = "''"; } $this->page_type = 'cart'; break; case FILENAME_CHECKOUT_SHIPPING: case FILENAME_CHECKOUT_PAYMENT: case FILENAME_CHECKOUT_CONFIRMATION: case FILENAME_CHECKOUT_SUCCESS: global $order, $currency, $currencies; if ($order && is_object($order)) { $products_id_list = array(); foreach ($order->products as $product) { $products_id_list[] = "'" . (int) $product['id'] . "'"; } if (count($products_id_list) <= 0) { $this->page_products_id = "''"; } elseif (count($products_id_list) == 1) { $this->page_products_id = $products_id_list[0]; } else { $this->page_products_id = '[' . implode(',', $products_id_list) . ']'; } $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; if ($scriptname == FILENAME_CHECKOUT_SHIPPING || $scriptname == FILENAME_CHECKOUT_PAYMENT) { // calculate the shipping tax if ($scriptname == FILENAME_CHECKOUT_PAYMENT) { require DIR_WS_CLASSES . 'shipping.php'; $shipping_modules = new shipping(); } $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_')); $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); } $this->page_totalvalue = number_format($order->info['total'] * $rate, $decimal_places); } else { $this->page_products_id = "''"; } $this->page_type = 'purchase'; break; case FILENAME_ADVANCED_SEARCH_RESULT: $this->page_products_id = "''"; $this->page_type = 'searchresults'; break; default: $this->page_products_id = "''"; $this->page_type = 'other'; } }
<div class="wrap_versions"> <div id="versions"> <?php $count_ver = 0; while ($version = tep_db_fetch_array($sql)) { if ($count_ver == 4) { break; } $count_ver++; ?> <div class="cyafll cya-info-pro-p-version"> <?php preg_match('/src="(.+?)"/', tep_image(DIR_WS_IMAGES . $version['products_image'], addslashes($version['products_name']), 300, 200), $match); $small_image = $match[1]; $price_group = cya_get_price_group_desc($_SESSION['customer_id']); if ($new_price = tep_get_products_special_price($version['products_id'])) { $products_price = '<s>' . $currencies->cya_display_price($version['products_price'], tep_get_tax_rate($version['products_tax_class_id']), 1, "", $version['products_id']) . '</s> <span class="productSpecialPrice">' . $currencies->cya_display_price($new_price, tep_get_tax_rate($version['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->cya_display_price($version['products_price'], tep_get_tax_rate($version['products_tax_class_id']), 1, "", $version['products_id']); } ?> <a target="_self" href="<?php echo tep_href_link('product_info.php', 'products_id=' . $version['products_id']); ?> "> <?php echo tep_image(DIR_WS_IMAGES . $version['products_image'], $version["products_name"], 150, 64, 'class="thumbnail"'); ?> </a> <div class="tooltip">
</div> <?php } ?> <?php if ($featured_products_split->number_of_rows > 0) { ?> <?php $featured_query = tep_db_query($featured_products_split->sql_query); $featured_prods_content = '<ul class="row product-listing">'; $i = 0; while ($featured = tep_db_fetch_array($featured_query)) { $i++; $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $featured['products_id'] . "' and language_id = '" . (int) $languages_id . "'"); $product = tep_db_fetch_array($product_query); if ($new_price = tep_get_products_special_price($featured['products_id'])) { $products_price = $currencies->display_price($featured['products_price'], tep_get_tax_rate($featured['products_tax_class_id'])); $products_price_new = $currencies->display_price($new_price, tep_get_tax_rate($featured['products_tax_class_id'])); } else { $products_price = $currencies->display_price($featured['products_price'], tep_get_tax_rate($featured['products_tax_class_id'])); $products_price_new = ''; } if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_GRID > 0) { if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_GRID) { $p_desc_grid = '<div class="product-description description-grid">' . mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_GRID, 'UTF-8') . '...' . '</div>'; } else { $p_desc_grid = '<div class="product-description description-grid">' . strip_tags($product['products_description']) . '</div>'; } } else { $p_desc_grid = ''; }
</div> <?php } ?> <?php if ($best_sellers_split->number_of_rows > 0) { ?> <?php $best_sellers_query = tep_db_query($best_sellers_split->sql_query); $best_sellers_content = '<ul class="row product-listing">'; $i = 0; while ($best_sellers = tep_db_fetch_array($best_sellers_query)) { $i++; $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $best_sellers['products_id'] . "' and language_id = '" . (int) $languages_id . "'"); $product = tep_db_fetch_array($product_query); if ($new_price = tep_get_products_special_price($best_sellers['products_id'])) { $products_price = $currencies->display_price($best_sellers['products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id'])); $products_price_new = $currencies->display_price($new_price, tep_get_tax_rate($best_sellers['products_tax_class_id'])); } else { $products_price = $currencies->display_price($best_sellers['products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id'])); $products_price_new = ''; } if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_GRID > 0) { if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_GRID) { $p_desc_grid = '<div class="product-description description-grid">' . mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_GRID, 'UTF-8') . '...' . '</div>'; } else { $p_desc_grid = '<div class="product-description description-grid">' . strip_tags($product['products_description']) . '</div>'; } } else { $p_desc_grid = ''; }
osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require 'includes/application_top.php'; $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'"); if (!tep_db_num_rows($product_info_query)) { tep_redirect(tep_href_link(FILENAME_REVIEWS)); } else { $product_info = tep_db_fetch_array($product_info_query); } if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } require DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS; $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS;
function get_products() { global $languages_id, $_SERVER, $customer_id; if (!is_array($this->contents)) { return false; } $products_array = array(); reset($this->contents); while (list($products_id, ) = each($this->contents)) { if (USE_PRICES_TO_QTY == 'true') { $products_query = tep_db_query("select p.products_id, pp.products_plant_id, pp.plant_price, pp.plant_maat, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_discount, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p JOIN " . TABLE_PRODUCTS_PLANT . " pp USING (products_model), " . TABLE_PRODUCTS_DESCRIPTION . " pd where pp.products_plant_id = '" . (int) $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'"); if (tep_db_num_rows($products_query) < 1) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'"); } } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int) $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'"); } if ($products = tep_db_fetch_array($products_query)) { $prid = $products['products_id']; if (USE_PRICES_TO_QTY == 'true') { //Calculate products price if (SOAP_STATUS == 'true') { if ($this->contents[$products_id]['price']) { $products_price = $this->contents[$products_id]['price']; } else { $products_price = showPriceTable($prid, $customer_id, $products['plant_maat'], $this->contents[$products_id]['qty'], $table = false); $this->contents[$products_id]['price'] = $products_price; } } else { $products_price = calculatePrice($products['plant_price'], $this->contents[$products_id]['qty']); if (isset($products['products_discount']) && strlen($products['products_discount']) > 2) { if ($tranche = explode(',', $products['products_discount'])) { foreach ($tranche as $cle => $trn) { if ($qty_px = explode(':', $trn)) { if ($this->contents[$products_id]['qty'] >= $qty_px[0]) { $products_price = $qty_px[1]; } } } } } } } else { if (SOAP_STATUS == 'true' && SOAP_PRICE == 'true') { if ($this->contents[$products_id]['price']) { $products_price = $this->contents[$products_id]['price']; } else { $products_price = showCustomerPrice($prid, $customer_id, $this->contents[$products_id]['qty']); $this->contents[$products_id]['price'] = $products_price; } } else { //DISCOUNT $discount_price = tep_get_discountprice($products['products_price'], $customer_id, $customer_group, $products['products_id'], $cPath, $products['manufacturers_id']); if ($discount_price['lowest']['discount'] > 0 || $discount_price['lowest']['price'] > 0 && PRICE_BOOK == 'true') { if ($new_price = tep_get_products_special_price($products['products_id'])) { if ($new_price < $discount_price['lowest']['price']) { $products_price = $new_price; } else { $products_price = $discount_price['lowest']['price']; } } else { $products_price = $discount_price['lowest']['price']; } } else { if ($new_price = tep_get_products_special_price($products['products_id'])) { $products_price = $new_price; } else { $products_price = $products['products_price']; } } if (PRICE_BOOK == 'true') { foreach ($discount_price['others'] as $prices) { if ($prices['min_amount'] <= $this->contents[$products_id]['qty'] && $prices['price'] < $products_price) { $products_price = $prices['price']; } } } //END DISCOUNT } } if (USE_PRICES_TO_QTY == 'true') { //Lets get all sized $products_sizes_query = tep_db_query("SELECT plant_description, plant_mc FROM " . TABLE_PRODUCTS_PLANT . " WHERE products_plant_id = '" . $products['products_plant_id'] . "'"); $products_size = tep_db_fetch_array($products_sizes_query); $qty_array = getPricesToQty($products_size['plant_price']); if ($products['plant_maat'] != '') { $maat = Translate('Maat') . ': ' . $products['plant_maat']; if ($products_size['plant_mc'] == 'hoogte') { $eenheid = ' cm.'; } elseif ($products_size['plant_mc'] == 'stamomtrek') { $eenheid = ' stamomtrek'; } elseif ($products_size['plant_mc'] == 'diameter') { $eenheid = ' diameter'; } else { $eenheid = ''; } } else { $maat = ''; $eenheid = ''; } if ($products_size['plant_description'] != '') { $descr = $products_size['plant_description']; } else { $descr = ''; } $products_array[] = array('id' => $prid, 'size_id' => $products['products_plant_id'], 'original_name' => $products['products_name'], 'name' => $products['products_name'], 'description' => '<span style="font-weight: normal;">' . $descr . '</span>', 'maat' => '<span style="font-weight: normal;">' . $maat . $eenheid . '</span>', 'size' => $products['plant_maat'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], 'final_price' => $products_price + $this->attributes_price($products_id), 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''); } else { $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], 'final_price' => $products_price + $this->attributes_price($products_id), 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''); } } } return $products_array; }