View Single Post
  #6  
Old 04-21-2008, 06:29 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: How to list all products in specific category in a box on the homepage?

Quote:
Originally Posted by yamiya
Hi,

I love your code. But is there anyway to display the prices and SKU just as in Featured Product Box? Also how do I sort them according to Product Name?

Hope to get an answer for that.

For sorting by Product Name change:

PHP Code:
if ((empty($cat))&&(empty($products)))
{
//number spec. cat :)))
    
$spec_cat "2"
    
$allproduct = array();
    
$allproduct func_query ("SELECT * FROM $sql_tbl[products]$sql_tbl[products_categories] WHERE $sql_tbl[products].productid=$sql_tbl[products_categories].productid AND $sql_tbl[products].forsale='Y' $avail AND $sql_tbl[products_categories].categoryid='$spec_cat' ORDER BY $sql_tbl[products].product");
    
$smarty->assign("allproduct"$allproduct);  

Reply With Quote