[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/modules/ -> xsell_products.php (source)

   1  <?php
   2  /* 

   3  $Id: xsell_products.php 12 2006-06-22 04:10:28Z user $

   4  

   5  osCMax Power E-Commerce 

   6  <http://oscdox.com> 

   7  

   8  Copyright 2006 osCMax2005 osCMax, 2002 osCommerce 

   9  

  10  Released under the GNU General Public License 

  11  */ 
  12  
  13  if ($HTTP_GET_VARS['products_id']) { 
  14  $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 = '" . $HTTP_GET_VARS['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 xp.sort_order asc limit " . MAX_DISPLAY_ALSO_PURCHASED);
  15  $num_products_xsell = tep_db_num_rows($xsell_query); 
  16  if ($num_products_xsell >= MIN_DISPLAY_ALSO_PURCHASED) { 
  17  ?> 
  18  <!-- xsell_products //-->
  19  <?php
  20        $info_box_contents = array();
  21        $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
  22        new contentBoxHeading($info_box_contents);
  23  
  24        $row = 0;
  25        $col = 0;
  26        $info_box_contents = array();
  27        while ($xsell = tep_db_fetch_array($xsell_query)) {
  28   
  29  
  30          $xsell['specials_new_products_price'] = tep_get_products_special_price($xsell['products_id']); 
  31  
  32  if ($xsell['specials_new_products_price']) { 
  33        $xsell_price =  '<span style="text-decoration:line-through">' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span><br>'; 
  34        $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; 
  35      } else { 
  36  
  37        $xsell_price =  $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); 
  38        
  39      } 
  40          $info_box_contents[$row][$col] = array('align' => 'center',
  41                                                 'params' => 'class="smallText" width="33%" valign="top"',
  42                                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $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>');
  43          $col ++;
  44          if ($col > 2) {
  45            $col = 0;
  46            $row ++;
  47          }
  48        }
  49        new contentBox($info_box_contents);
  50  ?>
  51  <!-- xsell_products_eof //-->
  52  
  53  
  54  
  55  
  56  <?php
  57      }
  58    }
  59  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7