View Single Post
  #84  
Old 04-06-2005, 06:43 AM
 
jdiehl jdiehl is offline
 

eXpert
  
Join Date: Dec 2003
Location: Kansas City, MO
Posts: 270
 

Default Figured it out for 4.0.12

After thinking about this problem with the descriptions not displaying on my version of 4.0.12. I began wondering if the SQL Query was even pulling out the description. And Tada, that's the problem right there.

(newbies to php and SQL queries be wary)

If you look at the file /*xcart_dir*/include/categories.php you will find on lines 74-78 (in version 4.0.12 at least) the code that looks like this:

Code:
if ($short_list) { $to_search = "$sql_tbl[categories].categoryid,$sql_tbl[categories].parentid, $sql_tbl[categories].categoryid_path,$sql_tbl[categories].category, $sql_tbl[categories].product_count,$sql_tbl[categories].avail, $sql_tbl[categories].order_by"; } else { $to_search = "$sql_tbl[categories].*"; }

It doesn't take much to see that if X-Cart pulls back the categories with $short_list set to TRUE (the default for category pages) then the description will not be included. so for the first "$to_search =" statement above just add ,$sql_tbl[categories].description between the quotes at the end. now your description variable will have a value in the template files.
so the {$subcategories[cat_num].description|escape} works! I have longer descriptions than that so I am going to see if the whole |truncate statement will work (i'm sure it will).

Thanks for this great mod.
__________________
Jason Diehl

Finding Cures for Your Online Headaches: http://www.internetmedicineman.com/
Reply With Quote