Can I show the product descriptions on item list?

  • Posts: 8
  • Thank you received: 1
12 years 6 months ago #48913

Hi all,

I was just told that we have to find a way to show each product's description (or dimensions at the very least) on the product list that shows when you click on a category. I'm not sure what we call this page, but here is the one I'm talking about: 50.116.92.232/~oldhouse/index.php?option...e=mantels&Itemid=137

We want to include the product description directly under the product title for each item so viewers do not have to click on every single product to quickly see the size. Can this be done, and if so, does anyone know what options to choose or what code I need to edit?

I really appreciate any help that can be offered.

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 6 months ago #48959

Hi,

The simplest option is to change the item box layout option of the module with the id 129 via the menu Display->Content modules to "image and description".
However, that will also change the layout of each item a bit.
If you don't want to change the layout, you can edit the file "listing_img_title" of the view "product" via the menu Display->Views and just add a line of code to display the description:
<?php echo $this->row->product_description; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
12 years 6 months ago #49005

Thanks for your help, Nicolas. Option one works okay, but I will probably have to go with a 2-column layout in that case because of the image being to the left of the title and description.
Ideally I'd like to get your second suggestion to work so I can have the image at the top, then the title and then the description underneath, but it's giving me problems.

Can you confirm that I am a) in the right view; and b) where I should insert the line if I want it to appear just under the title? I have pasted the line of code you suggested in several different spots within the code and I get no change whatsoever -- this makes me think I'm either in the wrong view, inserting the code in the wrong place, or maybe the field name we're calling is incorrect?

Display -> Views -> Front End - Product - listing-img-title

Original Code:

<?php
/**
* @package HikaShop for Joomla!
* @version 1.5.7
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway);
if($this->config->get('thumbnail')){ ?>
<!-- PRODUCT IMG -->
<div style="height:<?php echo $this->image->main_thumbnail_y;?>px;text-align:center;clear:both;" class="hikashop_product_image">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>">
<?php }
echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</div>
<!-- EO PRODUCT IMG -->
<!-- PRODUCT PRICE -->
<?php
}
if($this->params->get('show_price')){
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?>
<!-- EO PRODUCT PRICE -->
<!-- PRODUCT NAME -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php }
echo $this->row->product_name;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT NAME -->
<!-- ADD TO CART BUTTON AREA -->
<?php
if($this->params->get('add_to_cart')){
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
}?>
<!-- EO ADD TO CART BUTTON AREA -->
<?php
if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { ?>
<br/><?php
if( $this->params->get('show_compare') == 1 ) {
?>
<a class="hikashop_compare_button" href="<?php echo $link;?>" onclick="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this); return false;"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></a>
<?php } else { ?>
<input type="checkbox" class="hikashop_compare_checkbox" id="hikashop_listing_chk_<?php echo $this->row->product_id;?>" onchange="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this);"><label for="hikashop_listing_chk_<?php echo $this->row->product_id;?>"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></label>
<?php }
} ?>

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 6 months ago #49088

You're editing the correct file. If you don't see any change, it's probably that you're editing the correct file but not for the correct template. Make sure that you're editing it for the template you're using on the front end an not another one.

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum