- Posts: 108
- Thank you received: 2
Few Product Listing With Categories At One Page
I have tried for a long time to get my home page to display a category description and below a few products from the same category while in the page there are few categories or all, so it will look like having category 1 description and below products, category 2 description and below products etc.
I have managed to display one category description with 3 products with the Product listing menu, but i did not manage to get more on the same page including via modules. I used the module to display a different category's product but i couldn't add the description.
Thank you for reading.
Any suggestion will be welcomed.
Please Log in or Create an account to join the conversation.
For the description of the category though, hikashop does not display the description of the category no matter the options of the module.
We didn't thought that it would be something people want.
You would have to edit the file listing of the view product for your template via the menu Display->Views and change the code:
if(!$this->module){
if(($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
to:
if(true){ if(true){
$class = hikashop_get('class.category');
$this->element = $class->get(reset($this->pageInfo->filter->cid),true);
and the code:
if($this->params->get('show_description')&&!empty($this->element->category_description)){
to:
if(true){
That will force the description to always be displayed on a listing of products
Please Log in or Create an account to join the conversation.
if(!$this->module){
if(($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
or this line:
if($this->params->get('show_description')&&!empty($this->element->category_description)){
i think i looked in the right place, any thoughts?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
if(true){ if(true){
$class = hikashop_get('class.category');
$this->element = $class->get(reset($this->pageInfo->filter->cid),true);
Fatal error: Call to undefined function hikashop_get() in .../html/com_hikashop/product/listing.php on line 35
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Second, i noticed the update and i updated to 1.5.2 so i did what you said to replace at the first time, but it still does not working.
This is the part i changed, as far as i know PHP i cannot seem to find the problem.
if(true){
if(true){
?>
<div class="hikashop_category_description">
<?php
if(true){
$class = hikashop_get('class.category');
$this->element = $class->get(reset($this->pageInfo->filter->cid),true);
jimport('joomla.filesystem.file');
if(JFile::exists($this->image->getPath($this->element->file_path),false)){
?>
<img src="<?php echo $this->image->getPath($this->element->file_path); ?>" class="hikashop_category_image"/>
<?php
}
}
if(true){
?>
<p>
<?php echo JHTML::_('content.prepare',$this->element->category_description); ?>
</p>
<?php
}
?></div><?php
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Working like a charm.
Thank you
Please Log in or Create an account to join the conversation.