$cat.category..........desc?
So I'm developing a dynamic section that loads all the categories from $categories
And it's going perfectly. It loads the link, it loads the category picture. And I've figured out a way to make it so that the description COULD load next to it and still remain dynamic and neat and pretty. Der Problem How do I load the description? I'm pretty sure there's a variable like the variable categoryid. Only I need categorydesc. I tried taking the code from main/subcategories.tpl ( {$current_category.description} ) But unfortunately it doesn't load Der Info This is the code I have so far and the example is here (scroll to the bottom) Code:
<!-- Pulls the bot_cat class to make sure it stays within 900px --> Class bot_cat is just to make sure it wraps at 900px Class bot_products is the size 200px 12px margin for both sides (completely irrelevant to the problem) Der Request I want the text to load to the right of the Category Images. But I can't seem to load the descriptions... At all. Not even a little. Does anyone know what variable string it might be? or another solution? Also... Could I find this if I had DB access? (my boss isn't letting me have that access, but he might let me if I tell him I have to find it from there.) |
Re: $cat.category..........desc?
You probably have to edit php file responsible for writing the $category array and include description in the query. It just depends where you are doing this but take a look at function func_get_category_data($cat) in include/func/func.category.php
|
Re: $cat.category..........desc?
Thanks for the lead! I'll take a look at this right away
|
Re: $cat.category..........desc?
Der Find
So I went into *.*/include/func/func.category.php Unfortunately, there is no func_get_category_data($cat) However I did find func_get_category_parents down below Code:
function func_get_category_parents($categoryid) { I created a Test Variable to try and find where in the Database they placed the Descriptions in hopes of finding it. I'm not sure if this will help, but I figured it points to the location of where the descriptions are. Code:
INSERT INTO xcart_categories_lng VALUES ('US', 167, 'Door Closers', 'test 03'); Test 03 is where the information was placed. --- Is there someway that I could develop the functionality for xcart to get the information from where the description would be, if I copied the code for where it gets categoryid, and point it to where test 03 currently is? |
Re: $cat.category..........desc?
Ok I just saw you are on 4.1 and this was for 4.2. Sorry. The fuction for 4.1 is in include/categories.php
|
Re: $cat.category..........desc?
Wow, you really know where everything in xCart is. I found it and I'm looking for where I might find a variable for the description and if not, where it's getting categoryid so that I might be able to copy that functionality.
Any ideas on where to go from here while I'm searching? |
Re: $cat.category..........desc?
This query is in there
Code:
$to_search .= ",IF(($sql_tbl[categories_lng].category IS NOT NULL AND $sql_tbl[categories_lng].category != ''), $sql_tbl[categories_lng].category, $sql_tbl[categories].category) as category, IF(($sql_tbl[categories_lng].description IS NOT NULL AND $sql_tbl[categories_lng].description != ''), $sql_tbl[categories_lng].description, $sql_tbl[categories].description) as description, $sql_tbl[categories].category as category_name_orig"; The code is from 4.1.11 so don't just copy/paste |
Re: $cat.category..........desc?
Very cool
I found this code in include/categories.php although I'm not sure how to utilize it. To me it seems what I want is $categories.description or $category.description But unfortunately neither of those seem to work. Description seems to be the variable, since they seem to use categoryid similarly I'm pretty lost |
Re: $cat.category..........desc?
try this...
if ($short_list === X_CATEGORIES_FOR_SELECT_BOX) { added description to 3 $to_search = "$sql_tbl[categories].description, $sql_tbl[categories].categoryid as cid, $sql_tbl[categories].categoryid, $sql_tbl[categories].parentid, $sql_tbl[categories].categoryid_path, $sql_tbl[categories].category"; } elseif ($short_list) { $to_search = "$sql_tbl[categories].description, $sql_tbl[categories].categoryid as cid, $sql_tbl[categories].categoryid, $sql_tbl[categories].parentid, $sql_tbl[categories].categoryid_path, $sql_tbl[categories].category, $sql_tbl[categories].avail, $sql_tbl[categories].order_by"; } else { $to_search = "$sql_tbl[categories].description, $sql_tbl[categories].categoryid as cid, $sql_tbl[categories].*"; } |
Re: $cat.category..........desc?
1 Attachment(s)
Ummm... Where would I place that... -_-
(out for 40 minutes -_-) |
All times are GMT -8. The time now is 07:17 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.