Post by fujrer » Sun Mar 30, 2008 11:32 pm

I installed category description, but it is visible only in administration, not in frontend.

Newbie

Posts

Joined
Sun Mar 30, 2008 11:29 pm

Post by bruce » Mon Mar 31, 2008 11:53 am

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.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by SiteE@se » Mon Apr 07, 2008 8:51 pm

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!

Chris @ SiteE@se Web Design


Active Member

Posts

Joined
Mon Dec 17, 2007 7:40 am
Location - UK

Post by bruce » Mon Apr 07, 2008 8:53 pm

Show me what you have tried to do so far, and I will help you with it.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by osglass » Tue Apr 08, 2008 8:32 pm

I have already solve this problem..  :D.

---------------------
#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!!!!
Last edited by osglass on Tue Apr 08, 2008 8:36 pm, edited 1 time in total.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by trippy » Tue Apr 08, 2008 10:35 pm

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.... :)

New member

Posts

Joined
Sun Dec 16, 2007 5:12 pm

Post by osglass » Wed Apr 09, 2008 7:14 am

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.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by trippy » Wed Apr 09, 2008 5:07 pm

oh... oh.....
it was so simple!!!!!!
i didn't think about it!!!! how stupid am i??

New member

Posts

Joined
Sun Dec 16, 2007 5:12 pm

Post by osglass » Wed Apr 09, 2008 6:57 pm

hahaha!!!

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by SiteE@se » Fri Apr 11, 2008 3:59 pm

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?

Chris @ SiteE@se Web Design


Active Member

Posts

Joined
Mon Dec 17, 2007 7:40 am
Location - UK

Post by osglass » Fri Apr 11, 2008 8:13 pm

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!!!

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by graf1771 » Mon Apr 21, 2008 8:16 pm

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?

Newbie

Posts

Joined
Mon Apr 21, 2008 8:14 pm
Who is online

Users browsing this forum: No registered users and 2 guests