[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

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

   1  <?php
   2  /*

   3  $Id: also_purchased_products.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13    if (isset($HTTP_GET_VARS['products_id'])) {
  14      $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);
  15      $num_products_ordered = tep_db_num_rows($orders_query);
  16      if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
  17  ?>
  18  <!-- also_purchased_products //-->
  19  <?php
  20        $info_box_contents = array();
  21        $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);
  22  
  23        new contentBoxHeading($info_box_contents);
  24  
  25        $row = 0;
  26        $col = 0;
  27        $info_box_contents = array();
  28        while ($orders = tep_db_fetch_array($orders_query)) {
  29          $orders['products_name'] = tep_get_products_name($orders['products_id']);
  30          $info_box_contents[$row][$col] = array('align' => 'center',
  31                                                 'params' => 'class="smallText" width="33%" valign="top"',
  32                                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>');
  33  
  34          $col ++;
  35          if ($col > 2) {
  36            $col = 0;
  37            $row ++;
  38          }
  39        }
  40  
  41        new contentBox($info_box_contents);
  42  ?>
  43  <!-- also_purchased_products_eof //-->
  44  <?php
  45      }
  46    }
  47  ?>


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