change listing views

  • Posts: 47
  • Thank you received: 0
12 years 3 weeks ago #71425

hello

I have a question to ask

I would like to change the listin_table to have a table with 5 columns in this order

code - image - description - price - add to chart

thanks for reply

bye

sry for my english but i am italian and speak little english ;)

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

  • Posts: 13201
  • Thank you received: 2322
12 years 3 weeks ago #71559

Hi,

To edit this view you can go in HikaShop > Display > Views and edit "product / listing_table".
The informations needed are:
Product code:
<?php
echo $this->row->product_code;
?>
images are already present in this listing
$this->row->product_description
For the price:
<?php
$this->setLayout('listing_price');
echo $this->loadTemplate();
?>
Add to cart:
<?php
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
?>

You just have to put these informations between <td> ... </td> tags.

The following user(s) said Thank You: danilo87, responseit

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

  • Posts: 47
  • Thank you received: 0
12 years 3 weeks ago #71572

sry but i have not understand

i have this code in product/listing_table

<?php
/**
* @package HikaShop for Joomla!
* @version 1.6.0
* @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
if(!empty($this->rows)){
$pagination = $this->config->get('pagination','bottom');
if(in_array($pagination,array('top','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total >$this->pageInfo->limit->value){ $this->pagination->form = '_top'; ?>
<form action="<?php echo hikashop_currentURL(); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_top">
<div class="hikashop_products_pagination hikashop_products_pagination_top">
<?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
if ($this->config->get('show_quantity_field')>=2) { ?>
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form_<?php echo $this->params->get('main_div_name'); ?>" enctype="multipart/form-data">
<?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::_( 'PRODUCT' );?>
</th>
<?php if ($this->config->get('show_code')) { $columns++;?>
<th class="hikashop_product_code_title" align="center">
<?php echo JText::_( 'PRODUCT_CODE' ); ?>
</th>
<?php } ?>
<?php if($this->params->get('show_vote')){ ?>
<th class="hikashop_product_price title" align="center">
<?php echo JText::_('VOTE'); ?>
</th>
<?php } ?>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
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') || $this->params->get('add_to_wishlist')){ $columns++; ?>
<th class="hikashop_product_add_to_cart title" align="center">
</th>
<?php } ?>
<?php if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { $columns++; ?>
<th class="hikashop_product_compare title" align="center">
</th>
<?php } ?>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">

</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->rows as $row){
$this->row =& $row;
$height = $this->config->get('product_image_y');
$width = $this->config->get('product_image_x');
if(empty($height)) $height=$this->config->get('thumbnail_y');
if(empty($width)) $width=$this->config->get('thumbnail_x');
$divWidth=$width;
$divHeight=$height;
$this->image->checkSize($divWidth,$divHeight,$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 $divHeight;?>px;text-align:center;clear:both;" class="hikashop_product_image">
<div style="position:relative;text-align:center;clear:both;width:<?php echo $divWidth;?>px;margin: auto;" class="hikashop_product_image_subdiv">
<?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),"","", $width ,$height);
$main_thumb_x = $this->image->main_thumbnail_x;
$main_thumb_y = $this->image->main_thumbnail_y;
$horizontal = '0';
$vertical = -'10';
$this->classbadge->placeBadges($this->image, $this->row->badges, $vertical, $horizontal);
$this->image->main_thumbnail_x = $main_thumb_x;
$this->image->main_thumbnail_y = $main_thumb_y;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</div>
</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>
<?php if ($this->config->get('show_code')){ ?>
<td class="hikashop_product_code_row">
<?php
echo $this->row->product_code;
?>
</td>
<?php } ?>
<?php if($this->params->get('show_vote')){ ?>
<td class="hikashop_product_vote_row">
<?php
$this->row =& $row;
$this->setLayout('listing_vote');
echo $this->loadTemplate();
?>
</td>
<?php } ?>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
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">
<?php
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
?>
</td>
<?php } ?>
<?php
if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {
if( $this->params->get('show_compare') == 1 ) {
?>
<td class="hikashop_product_compare_row">
<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>
</td>
<?php } else { ?>
<td class="hikashop_product_compare_row">
<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>
</td>
<?php }
} ?>
</tr>
<?php } ?>
</tbody>
</table>
<?php if ($this->config->get('show_quantity_field')>=2) {
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form_'.$this->params->get('main_div_name').'\')){ return hikashopModifyQuantity(\'\',field,1,\'hikashop_product_form_'.$this->params->get('main_div_name').'\'); } return false;';
$this->row = null;
$this->row->product_quantity = -1;
$this->row->product_min_per_order = 0;
$this->row->product_max_per_order = -1;
$this->row->product_sale_start = 0;
$this->row->product_sale_end = 0;
$this->setLayout('quantity');
echo $this->loadTemplate();
if(!empty($this->ajax) && $this->config->get('redirect_url_after_add_cart','stay_if_cart')=='ask_user'){ ?>
<input type="hidden" name="popup" value="1"/>
<?php } ?>
<input type="hidden" name="hikashop_cart_type_0" id="hikashop_cart_type_0" value="cart"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>
</form>
<?php }
if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->pageInfo->limit->value){ $this->pagination->form = '_bottom'; ?>
<form action="<?php echo hikashop_currentURL(); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_bottom">
<div class="hikashop_products_pagination hikashop_products_pagination_bottom">
<?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>
<?php } ?>




where i must put that code?

thanks for reply

Last edit: 12 years 3 weeks ago by danilo87.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 3 weeks ago #71622

In this code you have elements between html <td> tags, like: "<td class="hikashop_product_name_row">".
So you have to put the previous informations between <td> tags.

Some knowledge in html are required.

You should have something like:

<td class="hikashop_product_code_row">
<?php
echo $this->row->product_code;
?>
</td>
<td class="hikashop_product_image_row">
<?php
	$this->row = & $this->element;
	$this->setLayout('show_block_img');
	echo $this->loadTemplate();
?>
</td>
<td class="hikashop_product_description_row">
<?php echo $this->row->product_description; ?>
</td>
<td class="hikashop_product_price_row">
<?php
$this->setLayout('listing_price');
echo $this->loadTemplate();
?>
</td>
<td class="hikashop_product_cart_row">
<?php
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
?>
</td>

The following user(s) said Thank You: danilo87, responseit

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

  • Posts: 47
  • Thank you received: 0
12 years 3 weeks ago #71642

perfect thanks

I was confusing between <?;php> and instead was more simple than I thought XD

thanks again ;)

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

  • Posts: 47
  • Thank you received: 0
12 years 3 weeks ago #71650

an other question sry

now i have

code - image - description - price - add to cart

but there isn't a box to add an amount to accompany the Add to Cart button. This means that only adds a quantity of 1 shopping cart and I need to have the ability for customers to enter an amount.

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 3 weeks ago #71725

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

  • Posts: 47
  • Thank you received: 0
12 years 3 weeks ago #71825

thanks so much

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

  • Posts: 10
  • Thank you received: 1
12 years 2 weeks ago #73462

This works to change the way things are displayed, however, we had to go and edit the PHP file directly as the editor in the backend doesn't seem to save anything we do in the CSS nor the PHP files.

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 2 weeks ago #73632

That can sometimes happen and in that case, disabling the code mirror editor plugin should solve the problem.

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

  • Posts: 10
  • Thank you received: 1
12 years 2 weeks ago #73738

Thank you. :) I must say. We used Virtuemart for years and recently tried Tienda and needed SOOOO much more including documentation and in search of a better product with the options we needed and a company that offered unrivalled support, we found the BEST! HikaShop is definitely a Web Design/Developers dream component and the support and documentation couldn't get any better. Thank you all.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.071 seconds
Powered by Kunena Forum