zen cart下架商品区域

2010-08-17 23:35 来源:www.chinab4c.com 作者:admin

    zen cart商品展示做的是非常不做。但是唯一的缺点就是zen cart下架商品区域这个功能缺少.我们可以通过对zen cart二次开发,通过结合zen cart搜索页面的修改和处理,来达到取得zen cart下架商品列表。

  1:在zen cart搜索页面增加一个变量:unsale

  2:advanced_search_result/header_php.php增加以下代码。

 $string_status = '';
if(isset($_GET['unsale'])){
 $where_str = " WHERE (p.products_status = 0
               AND p.products_id = pd.products_id
               AND pd.language_id = :languagesID
               AND p.products_id = p2c.products_id
               AND p2c.categories_id = c.categories_id ";
}else{
 $where_str = " WHERE (p.products_status = 1
               AND p.products_id = pd.products_id
               AND pd.language_id = :languagesID
               AND p.products_id = p2c.products_id
               AND p2c.categories_id = c.categories_id ";
}

  3:product_info/header_php.php

 $sql = "select count(*) as total
          from " . TABLE_PRODUCTS . " p, " .
                   TABLE_PRODUCTS_DESCRIPTION . " pd
          where  
             p.products_id = '" . (int)$_GET['products_id'] . "'
          and      pd.products_id = p.products_id
          and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

 这里排除检索product_status = 1的。

 这样就完成了zen cart下架商品区域的二次开发

来源:http://www.chinab4c.com