[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/modules/pages/featured_products/ -> header_php.php (source)

   1  <?php
   2  /**

   3   * Featured Products

   4   *

   5   * @package page

   6   * @copyright Copyright 2003-2006 Zen Cart Development Team

   7   * @copyright Portions Copyright 2003 osCommerce

   8   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   9   * @version $Id: header_php.php 4261 2006-08-25 04:35:20Z ajeh $

  10   */
  11  require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
  12  $breadcrumb->add(NAVBAR_TITLE);
  13  // display order dropdown

  14  $disp_order_default = PRODUCT_FEATURED_LIST_SORT_DEFAULT;
  15  
  16  require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
  17  
  18  $featured_products_array = array();
  19  
  20  $featured_products_query_raw = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
  21                                    p.product_is_always_free_shipping, p.products_qty_box_status
  22                                    FROM (" . TABLE_PRODUCTS . " p
  23                                    LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
  24  TABLE_PRODUCTS_DESCRIPTION . " pd
  25                                    LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
  26                                    WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
  27                                    AND p.products_id = pd.products_id and pd.language_id = :languagesID " .
  28  $order_by;
  29  
  30  $featured_products_query_raw = $db->bindVars($featured_products_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');
  31  $featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS);
  32  
  33  //check to see if we are in normal mode ... not showcase, not maintenance, etc

  34  $show_submit = zen_run_normal();
  35  
  36  // check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed

  37  if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) {
  38  
  39    // check how many rows

  40    $check_products_all = $db->Execute($featured_products_split->sql_query);
  41    $how_many = 0;
  42    while (!$check_products_all->EOF) {
  43      if (zen_has_product_attributes($check_products_all->fields['products_id'])) {
  44      } else {
  45        // needs a better check v1.3.1

  46        if ($check_products_all->fields['products_qty_box_status'] != 0) {
  47          if (zen_get_products_allow_add_to_cart($check_products_all->fields['products_id']) !='N') {
  48            if ($check_products_all->fields['product_is_call'] == 0) {
  49              if ((SHOW_PRODUCTS_SOLD_OUT_IMAGE == 1 and $check_products_all->fields['products_quantity'] > 0) or SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) {
  50                if ($check_products_all->fields['products_type'] != 3) {
  51                  if (zen_has_product_attributes($check_products_all->fields['products_id']) < 1) {
  52                    $how_many++;
  53                  }
  54                }
  55              }
  56            }
  57          }
  58        }
  59      }
  60      $check_products_all->MoveNext();
  61    }
  62  
  63    if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
  64      $show_top_submit_button = true;
  65    } else {
  66      $show_top_submit_button = false;
  67    }
  68    if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
  69      $show_bottom_submit_button = true;
  70    } else {
  71      $show_bottom_submit_button = false;
  72    }
  73  }
  74  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics