Page 1 of 1
Category Description isn't visible
Posted: Sun Mar 30, 2008 11:32 pm
by fujrer
I installed category description, but it is visible only in administration, not in frontend.
Re: Category Description isn't visible
Posted: Mon Mar 31, 2008 11:53 am
by bruce
That is correct.
There is no place in the standard OpenCart that uses the values because Category Description does not exist in standard OpenCart.
You can see the values added from the admin, in the category_description table but if you want to use them, you will have to write your own code to get the data from the database and display it in the front end.
Re: Category Description isn't visible
Posted: Mon Apr 07, 2008 8:51 pm
by SiteE@se
It would certainly be useful to have this, otherwise there is little value in only having the additional functionality in the back end. Has anyone implemented it in the front end and willing to share the mods? Must confess I'm struggling on this!
Re: Category Description isn't visible
Posted: Mon Apr 07, 2008 8:53 pm
by bruce
Show me what you have tried to do so far, and I will help you with it.
Re: Category Description isn't visible
Posted: Tue Apr 08, 2008 8:32 pm
by osglass
I have already solve this problem..

.
---------------------
#1 GOLDEN RULES: Backup your files first!!!!
On the catalog ->controller->category.php
Look for this code:
$category_info = $database->getRow("select distinct name from category c left join category_description cd on (c.category_id = cd.category_id) where c.category_id = '" . (int)((!$request->get('path')) ? '0' : (int)end(explode('_', $request->get('path')))) . "' and cd.language_id = '" . (int)$language->getId() . "'");
below that Add this code:
$category_info = $database->getRow("select distinct name,
description from category c left join category_description cd on (c.category_id = cd.category_id) where c.category_id = '" . (int)((!$request->get('path')) ? '0' : (int)end(explode('_', $request->get('path')))) . "' and cd.language_id = '" . (int)$language->getId() . "'");
Look for this code:
$view->set('products', $product_data);
$view->set('heading_title', $category_info['name']);
below that Add this code:
$view->set('entry_description', $category_info['description']);
Look for this code:
$view->set('heading_title', $category_info['name']);
below that Add this code:
$view->set('entry_description', $category_info['description']);
and
Look for this code:
$view->set('heading_title', $language->get('text_error'));
below that Add this code:
$view->set('entry_description', $language->get('text_error'));
On the template->default->content->category.tpl
Add this code:
-----------------
put something on the description on the admin side and then check your frontend.
Thats IT!!!!
Re: Category Description isn't visible
Posted: Tue Apr 08, 2008 10:35 pm
by trippy
Hallo osglass!!
i've tried your code and it works... great!!!!
but... if i'd like to insert an image (not the thumb, just an image)? .... for example the logo of a manufacturer... ?
i think i should add something like "left join image ecc" to "$category_info" ....
and then?
i'll try to give a look but i think i'll have no big results...
if you can help me with the solution....

Re: Category Description isn't visible
Posted: Wed Apr 09, 2008 7:14 am
by osglass
trippy wrote:
Hallo osglass!!
i've tried your code and it works... great!!!!
but... if i'd like to insert an image (not the thumb, just an image)? .... for example the logo of a manufacturer... ?
i think i should add something like "left join image ecc" to "$category_info" ....
and then?
i'll try to give a look but i think i'll have no big results...
if you can help me with the solution....
Heres a quick solution to your problem.
IF you want to add an image. Register to photobucket.com
Yeah i always host my images externally.
Photobucket procedures:
After your done signing up-> upload the image-> get the link.
Opencart procedures:
open a browser-> login to admin-> go to Category Description-> then look for 'insert image' click that and type the url of your image in photobucket.com
Heres a screenshot:
http://i25.tinypic.com/28qqgs4.png[/img]
http://i31.tinypic.com/ilao38.png[/img]
Thats it.
Re: Category Description isn't visible
Posted: Wed Apr 09, 2008 5:07 pm
by trippy
oh... oh.....
it was so simple!!!!!!
i didn't think about it!!!! how stupid am i??
Re: Category Description isn't visible
Posted: Wed Apr 09, 2008 6:57 pm
by osglass
hahaha!!!
Re: Category Description isn't visible
Posted: Fri Apr 11, 2008 3:59 pm
by SiteE@se
Thanks for kindly sharing this, osglass.
That's what I love about this community ..... you post a problem/query, take your wife away for a couple of days and return to find that it has been well answered! I can see where I was going wrong with my own attempts.
Perhaps category descriptions will be a standard feature of v8?
Re: Category Description isn't visible
Posted: Fri Apr 11, 2008 8:13 pm
by osglass
Not a problem. I dont have to wait for the next release. I can create, remove and extend the functionality of the opencart. See you later!!!
Re: Category Description isn't visible
Posted: Mon Apr 21, 2008 8:16 pm
by graf1771
This is all excellent, just what I need... but I'm also trying to get the category description to appear on the template/module/category.tpl
On the site I'm building the category names appear on every page and I'd like the description to show there as well - I'm sure it's very easy but I can't quite figure it out! Any ideas?