View Single Post
  #2  
Old 02-03-2012, 05:15 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Available stock to featured admin

You should alter the PHP script first (admin/categories.php) and add the required data selection, e.g. like this:
Code:
$products = func_query ("SELECT $sql_tbl[featured_products].productid, $sql_tbl[products].product, $sql_tbl[featured_products].product_order, $sql_tbl[featured_products].avail, $sql_tbl[products].product from $sql_tbl[featured_products], $sql_tbl[products].avail AS in_stock where $sql_tbl[featured_products].productid=$sql_tbl[products].productid AND $sql_tbl[featured_products].categoryid='$f_cat' order by $sql_tbl[featured_products].product_order");

After that you can use something like {$products[productid].in_stock} in the template.

Note: the example SQL wont work for products with variants due to the fact that variants stock is stored in another table. more complex SQL will be required.

You can find more info about X-Cart DB structure here.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote