Here' what I did..
There was a previous post that put up a older version of the bestsellers.php file. I used it and it worked immediately. Here it is:
<?
/************************************************** ***************************\
+-----------------------------------------------------------------------------+
| X-Cart |
| Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved. |
+-----------------------------------------------------------------------------+
| The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized |
| reproduction of software or use of illegally obtained software. Making |
| illegal copies of software is prohibited. Individuals who violate copyright |
| law and software licensing agreements may be subject to criminal or civil |
| action by the owner of the copyright. |
| |
| 1. It is illegal to copy a software, and install that single program for |
| simultaneous use on multiple machines. |
| |
| 2. Unauthorized copies of software may not be used in any way. This applies |
| even though you yourself may not have made the illegal copy. |
| |
| 3. Purchase of the appropriate number of copies of a software is necessary |
| for maintaining legal status. |
| |
| DISCLAIMER |
| |
| THIS SOFTWARE IS PROVIDED BY THE Ruslan R. Fazliev TEAM ``AS IS'' AND ANY |
| EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| DISCLAIMED. IN NO EVENT SHALL THE Ruslan R. Fazliev TEAM OR ITS |
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
| The Initial Developer of the Original Code is Ruslan R. Fazliev. |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002 |
| Ruslan R. Fazliev. All Rights Reserved. |
+-----------------------------------------------------------------------------+
\************************************************* ****************************/
#
# $Id: bestsellers.php,v 1.4 2002/09/10 08:09:12 svowl Exp $
#
# Bestsellers
#
#
# Get products data for current category and store it into $products array
#
if ($cat) {
$category_name = array_pop(func_query_first("SELECT category FROM $sql_tbl[categories] WHERE categoryid='$cat'"));
$result = func_query("SELECT categoryid FROM $sql_tbl[categories] WHERE category LIKE '$category_name%'");
$str = "(";
foreach($result as $k=>$v) {
$str .= "$sql_tbl[products].categoryid='$v[categoryid]' OR $sql_tbl[products].categoryid1='$v[categoryid]' OR $sql_tbl[products].categoryid2='$v[categoryid]' OR $sql_tbl[products].categoryid3='$v[categoryid]' OR ";
}
$str = ereg_replace(" OR $", ")", $str);
$search_query = "$str and $sql_tbl[products].forsale='Y' and $sql_tbl[products].avail>0 and $sql_tbl[products].views_stats>0 group by $sql_tbl[products].productid order by sales_stats DESC, views_stats DESC limit ".$config["Modules"]["number_of_bestsellers"];
}
else
$search_query = "$sql_tbl[products].forsale='Y' and $sql_tbl[products].avail>0 group by $sql_tbl[products].productid order by sales_stats DESC, views_stats DESC limit ".$config["Modules"]["number_of_bestsellers"];
# $bestsellers = func_query("SELECT $sql_tbl[products].* from $sql_tbl[products] WHERE $search_query");
$bestsellers = func_search_products($search_query, $user_account['membership']);
$smarty->assign("bestsellers",$bestsellers);
?>
This is bestsellers.php, not bestsellers.tpl. Try it.
|