Hi,
For design reasons, I need to pass to category.tpl the category_id and the language_id from the category_description table, so I can be able to add a description for each category depending on the language selected by the user, with an if cycle...
Thanks in advanced for the help,
Sergio
For design reasons, I need to pass to category.tpl the category_id and the language_id from the category_description table, so I can be able to add a description for each category depending on the language selected by the user, with an if cycle...
Thanks in advanced for the help,
Sergio
Me again...
Maybe a dumb question, but, where's going to show the category description ?...
What I was thinking, is show the desc in the product page, example:
http://lyvjoyeria.com/tienda/index.php? ... ry&path=22 here, at the top...
(already added a desc to that category)
Sergio
Maybe a dumb question, but, where's going to show the category description ?...
What I was thinking, is show the desc in the product page, example:
http://lyvjoyeria.com/tienda/index.php? ... ry&path=22 here, at the top...
(already added a desc to that category)
Sergio
The "Category Description" package only contains the administrative components and doesn't contain the catalog components (you need to add these yourself).
In "catalog/controller/category.php", change line 19 from -
to
Insert at line 83 in the same file -
Then insert the following line to "catalog/template/default/content/category.tpl" (line 7):-
This should get the category description displaying on the category page when there are products or sub-categories attached to it.
Fido-X.
In "catalog/controller/category.php", change line 19 from -
Code: Select all
$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->gethtml('path')) ? '0' : (int)end(explode('_', $request->gethtml('path')))) . "' and cd.language_id = '" . (int)$language->getId() . "'");
Code: Select all
$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->gethtml('path')) ? '0' : (int)end(explode('_', $request->gethtml('path')))) . "' and cd.language_id = '" . (int)$language->getId() . "'");
Code: Select all
$view->set('description', html_entity_decode($category_info['description']));
Code: Select all
<?php echo $description; ?>
Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Thank you for your answer 
I guess was because my OC version, but I had to change the 'gethtml('path'))' part to 'get('path'))', and the output for description by line 19th ...
Thanks anyway
Sergio

I guess was because my OC version, but I had to change the 'gethtml('path'))' part to 'get('path'))', and the output for description by line 19th ...
Thanks anyway

Sergio
gethtml was added in 0.7.9RC4. For versions before 0.7.9RC4 you need to change gethtml to get. This will happen more as new contributions come and people try to apply it to versions before 0.7.9RC4sroblesruiz wrote: I guess was because my OC version, but I had to change the 'gethtml('path'))' part to 'get('path'))', and the output for description by line 19th ...
The answer to your question can also be found by searching "category descriptions". The original answer in this forum doesn't have the gethtml problem
Who is online
Users browsing this forum: No registered users and 3 guests