How do I display product code in prodict listings?

  • Posts: 7
  • Thank you received: 0
13 years 5 months ago #19802

Hi guys

First off; hikashop is an awesome alternative to virtuemart. Great work.

Could someone please tell me how I include the product code in product listing.

I want the following site: -
ukcctvlimited.co.uk/index.php?option=com...me-cameras&Itemid=67

To look like this: -
e-dis.net/Products/category/CCTV+Cameras...thing_/man/_nothing_

I want customers to see:
Product image, product code, and product description

I've gone through every single post in forum regarding product_code and to no joy.

Taking out following code from front-end css does not work either.
.hikashop_product_code_main{
display:none;
}

Any help would be most appreciated.

Many thanks

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 5 months ago #19803

You need to go in the menu Display->Views and edit the file listing_table. There, you will need to add a new column in the table tag in order to show the product code in there.
You will also have to add the product description display after the product name in that same file.
For the price and the add to cart button, you need to go in the menu Display->Content modules and edit your module with the id 53. There, you have options to activate them.

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

  • Posts: 7
  • Thank you received: 0
13 years 5 months ago #19805

wow - talk about awesome customer support.

I shall action what you suggest and get back to you.

Thank you again for the super quick response.

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

  • Posts: 7
  • Thank you received: 0
13 years 5 months ago #19808

I've been looking at product/listing_table.php for an hour now. I have zero php experience which doesn't help :-(

I thought I'd done it, but not quite.
ukcctvlimited.co.uk/index.php?option=com...me-cameras&Itemid=67

Here is code. Am I on the right track? (additions I made are in red)

<?php
/**
* @package HikaShop for Joomla!
* @version 1.5.0
* @author hikashop.com
* @copyright (C) 2010-2011 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
if(!empty($this->rows)){
if($this->config->get('pagination','bottom')=='top' && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->params->get('limit')){ ?>
<form action="<?php echo hikashop::completeLink(JRequest::getWord('ctrl').'&task='.JRequest::getWord('task').$this->itemid.'&cid='.reset($this->pageInfo->filter->cid)); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>">
<div class="hikashop_products_pagination">
<?php echo $this->pagination->getListFooter(); ?>
<span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span>
</div>
<input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php } ?>
<div class="hikashop_products">
<?php
$columns = 1; ?>
<table class="hikashop_products_table adminlist" cellpadding="1">
<thead>
<tr>
<?php if($this->config->get('thumbnail')){ $columns++; ?>
<th class="hikashop_product_image title" align="center">
<?php echo JText::_( 'HIKA_IMAGE' );?>
</th>
<?php } ?>
<th class="hikashop_product_name title" align="center">
<?php echo JText::_( 'Description' );?>
</th>
<th class="hikashop_product_code title" align="center">
<?php echo JText::_( 'Product Code' );?>
</th>

<?php if($this->params->get('show_price')){ $columns++; ?>
<th class="hikashop_product_price title" align="center">
<?php echo JText::_('PRICE'); ?>
</th>
<?php } ?>
<?php if($this->params->get('add_to_cart')){ $columns++; ?>
<th class="hikashop_product_add_to_cart title" align="center">
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
<?php if($this->config->get('pagination','bottom')=='bottom' && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->params->get('limit')){ ?>
<form action="<?php echo hikashop::completeLink(JRequest::getWord('ctrl').'&task='.JRequest::getWord('task').$this->itemid.'&cid='.reset($this->pageInfo->filter->cid)); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>">
<div class="hikashop_products_pagination">
<?php echo $this->pagination->getListFooter(); ?>
<span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span>
</div>
<input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php } ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->rows as $row){
$this->row =& $row;
$link = hikashop::completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway); ?>
<tr>
<?php if($this->config->get('thumbnail')){ ?>
<td class="hikashop_product_image_row">
<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));
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</div>
</td>
<?php } ?>
<td class="hikashop_product_name_row">
<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)){ ?>
echo $this->row->product_name;
if($this->params->get('link_to_product_code',1)){ ?>

</a>
<?php } ?>
</span>
</td>
<?php if($this->params->get('show_price')){ ?>
<td class="hikashop_product_price_row">
<?php
$this->setLayout('listing_price');
echo $this->loadTemplate();
?>
</td>
<?php } ?>
<?php if($this->params->get('add_to_cart')){ ?>
<td class="hikashop_product_add_to_cart_row">
<form action="<?php echo hikashop::completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form_<?php echo $this->row->product_id.'_'.$this->params->get('main_div_name'); ?>"><?php
$this->params->set('show_quantity_field', 2);
$this->ajax='';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
<input type="hidden" name="product_id" value="<?php echo $this->row->product_id; ?>" />
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
</form>
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php } ?>

Last edit: 13 years 5 months ago by riv_dev.

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

  • Posts: 7
  • Thank you received: 0
13 years 5 months ago #19811

For those who come across this issue of placing product code or any other column in product listing, here is the solution. (Don't ask me how I did it, considering I know zero php)...

Additions in red

<?php
/**
* @package HikaShop for Joomla!
* @version 1.5.0
* @author hikashop.com
* @copyright (C) 2010-2011 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
if(!empty($this->rows)){
if($this->config->get('pagination','bottom')=='top' && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->params->get('limit')){ ?>
<form action="<?php echo hikashop::completeLink(JRequest::getWord('ctrl').'&task='.JRequest::getWord('task').$this->itemid.'&cid='.reset($this->pageInfo->filter->cid)); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>">
<div class="hikashop_products_pagination">
<?php echo $this->pagination->getListFooter(); ?>
<span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span>
</div>
<input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php } ?>
<div class="hikashop_products">
<?php
$columns = 1; ?>
<table class="hikashop_products_table adminlist" cellpadding="1">
<thead>
<tr>
<?php if($this->config->get('thumbnail')){ $columns++; ?>
<th class="hikashop_product_image title" align="center">
<?php echo JText::_( 'HIKA_IMAGE' );?>
</th>
<?php } ?>
<th class="hikashop_product_name title" align="center">
<?php echo JText::_( 'Description' );?>
</th>
<th class="hikashop_product_code title" align="center">
<?php echo JText::_( 'Product Code' );?>
</th>

<?php if($this->params->get('show_price')){ $columns++; ?>
<th class="hikashop_product_price title" align="center">
<?php echo JText::_('PRICE'); ?>
</th>
<?php } ?>
<?php if($this->params->get('add_to_cart')){ $columns++; ?>
<th class="hikashop_product_add_to_cart title" align="center">
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
<?php if($this->config->get('pagination','bottom')=='bottom' && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->params->get('limit')){ ?>
<form action="<?php echo hikashop::completeLink(JRequest::getWord('ctrl').'&task='.JRequest::getWord('task').$this->itemid.'&cid='.reset($this->pageInfo->filter->cid)); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>">
<div class="hikashop_products_pagination">
<?php echo $this->pagination->getListFooter(); ?>
<span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span>
</div>
<input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php } ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->rows as $row){
$this->row =& $row;
$link = hikashop::completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway); ?>
<tr>
<?php if($this->config->get('thumbnail')){ ?>
<td class="hikashop_product_image_row">
<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));
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</div>
</td>
<?php } ?>
<td class="hikashop_product_name_row">
<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>
</td>

<td class="hikashop_product_code_row">
<span class="hikashop_product_code">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php }
echo $this->row->product_code;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
</td>




<?php if($this->params->get('show_price')){ ?>
<td class="hikashop_product_price_row">
<?php
$this->setLayout('listing_price');
echo $this->loadTemplate();
?>
</td>
<?php } ?>
<?php if($this->params->get('add_to_cart')){ ?>
<td class="hikashop_product_add_to_cart_row">
<form action="<?php echo hikashop::completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form_<?php echo $this->row->product_id.'_'.$this->params->get('main_div_name'); ?>"><?php
$this->params->set('show_quantity_field', 2);
$this->ajax='';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
<input type="hidden" name="product_id" value="<?php echo $this->row->product_id; ?>" />
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
</form>
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php } ?>

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 5 months ago #19815

Yes that's exactly that :)

Basically, it's a copy/paste of the product name column by replacing name by code.

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

  • Posts: 7
  • Thank you received: 0
13 years 3 months ago #22920

Hi

I'm having problems duplicating the same layout you guys helped me solve for a new product category.

The layout required looks like this (this is the layout I want): -
ukcctvlimited.co.uk/index.php?option=com...me-cameras&Itemid=67

Now, after adding products to the the next menu item; Digital Video Recorders
The layout looks like this (NOT showing products in same format as 'CCTV Cameras' menu item: -
ukcctvlimited.co.uk/index.php?option=com...range-dvrs&Itemid=68

The listing_table file in menu Display->Views is the same for both categories, yet they show different layouts for products.

If anybody could help, I'd be most grateful. I have tried all options, and I am at a loss.

Many thanks

Last edit: 13 years 3 months ago by riv_dev.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #22928

Hi,

You just need to you your listing_table layout in the associated module of your new menu. When you're on your menu's hikashop options, you can click on the associated module link to access the options of the module. There, just change the layout to table.

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

  • Posts: 7
  • Thank you received: 0
13 years 3 months ago #22934

Hi nicolas

I'm still having trouble finding the solution.

If I click on Display - content modules within 'hikashop options' the settings are same as 'cctv cameras' module which is how I want layout to look. See screenshot 1



Am I looking in the right place? Do I need to change any code?

"listing_table layout in the associated module of your new menu"
How do I do this. When hikashop options is clicked. It won't let me change Type of layout from div to table. Error message - 'The category content does not support table layout display'

Many thanks for your help.

Attachments:
Last edit: 13 years 3 months ago by riv_dev. Reason: too waffly

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #22940

You need to edit the hikashop options of the module with the id 57 and change the layout to table. That's the associated module of your menu.

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

  • Posts: 7
  • Thank you received: 0
13 years 3 months ago #22968

Hi Nicolas

I've managed to fix problem. All I can say is thank you sooooooo much. You guys are the best.

PS I wish Joomla wasn't so difficult to use.

Thank you again.

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

Time to create page: 0.050 seconds
Powered by Kunena Forum