<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

  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, pd.products_description 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);
  }

  //TotalB2B start
  $product_info['products_price'] = tep_xppp_getproductprice($product_info['products_id']);
  //TotalB2B end

  if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

    //TotalB2B start
    $query_special_prices_hide_result = SPECIAL_PRICES_HIDE; 
    if ($query_special_prices_hide_result == 'true') {
      $products_price = '<span class="productSpecialPrice">' . $currencies->display_price_nodiscount($product_info['products_id'], $new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
	} else {
      $products_price = '<s>' . $currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodiscount($product_info['products_id'], $new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
	}
    //TotalB2B end
  
  } else {
    $products_price = $currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
  }

  if (tep_not_null($product_info['products_model'])) {
    $products_name = '<span class="ProductTile">' . $product_info['products_name'] . '</span><br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
  } else {
    $products_name = '<span class="ProductTile">' . $product_info['products_name'] . '</span>';
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));

  $content = CONTENT_PRODUCT_REVIEWS;
  $javascript = 'popup_window.js';

  include (bts_select('main', $content_template)); // BTSv1.5

  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
