[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/boxes/ -> specials.php (source)

   1  <?php
   2  /*

   3  $Id: specials.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  // Most of this file is changed or moved to BTS - Basic Template System - format.

  14  
  15    if (isset($HTTP_GET_VARS['products_id'])){
  16        
  17  // BOF Separate Price per Customer

  18  /*  if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { */

  19  
  20  //  global variable (session): $sppc_customers_group_id -> local variable $customer_group_id

  21  
  22    if(!tep_session_is_registered('sppc_customer_group_id')) { 
  23    $customer_group_id = '0';
  24    } else {
  25     $customer_group_id = $sppc_customer_group_id;
  26    }
  27  
  28    if ($customer_group_id == '0')  {
  29        $random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '0' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
  30    } else { // $sppc_customer_group_id is in the session variables, so must be set
  31        $random_product = tep_random_select("select p.products_id, pd.products_name, IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id, customers_group_id) where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id= '".$customer_group_id."' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
  32      }
  33  
  34    if (tep_not_null($random_product)) {
  35  // EOF Separate Price per Customer      

  36  ?>
  37  <!-- specials //-->
  38  <?php
  39    $boxHeading = BOX_HEADING_SPECIALS;
  40    $corner_left = 'square';
  41    $corner_right = 'square';
  42    $boxContent_attributes = ' align="center"';
  43    $boxLink = '<a href="' . tep_href_link(FILENAME_SPECIALS) . '"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a>';
  44    $box_base_name = 'specials'; // for easy unique box template setup (added BTSv1.2)

  45  
  46    $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

  47    $boxContent = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $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><span style="text-decoration:line-through">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
  48  
  49  
  50  
  51  
  52  
  53  include (bts_select('boxes', $box_base_name)); // BTS 1.5

  54    $boxLink = '';
  55    $boxContent_attributes = '';
  56  ?>
  57  <!-- specials_eof //-->
  58  <?php
  59    }
  60   } 
  61  ?>


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