Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- $Id
- osCommerce, Open Source E-Commerce Solutions
- <http://www.oscommerce.com>
- Copyright (c) 2018 osCommerce
- Released under the GNU General Public License
- */
- //fixed bug
- if ((USE_CACHE == 'true') && empty($SID)) {
- // include currencies class and create an instance
- require_once('includes/classes/currencies.php');
- $currencies = new currencies();
- }
- if ($_GET['products_id']) {
- $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price
- from products_xsell xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id
- left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
- left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
- where xp.products_id = '" . $_GET['products_id'] . "'
- and p.products_status = '1'
- order by sort_order asc limit " . MAX_DISPLAY_XSELL);
- $num_products_xsell = tep_db_num_rows($xsell_query);
- if ($num_products_xsell > 0) {
- ?>
- <div class="col-sm-12">
- <h3><?php echo TEXT_XSELL_PRODUCTS; ?></h3>
- <div class="row list-group">
- <?php
- $position = 1;
- while ($xsell = tep_db_fetch_array($xsell_query)) {
- ?>
- <div class="col-sm-3">
- <div class="thumbnail equal-height">
- <?php
- if (tep_not_null($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']));
- }
- ?>
- <?php
- if ($xsell['image_display'] == 1) {
- echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . tep_image('includes/languages/' . $language . '/images/' . 'no_picture.gif', TEXT_NO_PICTURE, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
- } elseif (($xsell['image_display'] != 2) && tep_not_null($xsell['products_image'])) {
- echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . tep_image('images/' . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
- }
- ?>
- <div class="caption">
- <p class="text-center">
- <?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a>'; ?>
- </p>
- <hr>
- <p class="text-center">
- <?php echo $xsell_price; ?>
- </p>
- <div class="text-center">
- <div class="btn-group">
- <a href="<?php echo tep_href_link('product_info.php', tep_get_all_get_params(array('action')) . 'products_id=' . $xsell['products_id']); ?>" class="btn btn-default" role="button"><?php echo SMALL_IMAGE_BUTTON_VIEW; ?></a>
- <?php echo '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now_xsell&products_id=' . (int)$xsell['products_id']) . '" class="btn btn-success btn-index btn-buy" role="button">' . SMALL_IMAGE_BUTTON_BUY . '</a>'; ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php
- $position++;
- } //eof while
- ?>
- </div>
- </div>
- <?php
- } // eof ($num_products_xsell > 0)
- } // eof $_GET['products_id']
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement