product listing table, are custom fields possible?

  • Posts: 37
  • Thank you received: 2
11 years 11 months ago #82214

My goal is to display my products in 1 column, table view with 3 custom fields displayed in the same format as vote, price and product.

I believe I need to add them to, product / listing_table, but I'm not sure how.

I've found a few threads that discuss this however I haven't found one that discusses my specific need.


I have been able to display a custom field using the default settings, however this display doesn't suit my needs as I need them displayed as columns.

My main purpose is to be able to display my products in 1 column and easily compare custom fields, My coding is experience is pretty much non-existent. If you could suggest a way which I could achieve this I would be very grateful, thanks..

Here is an example of what I'm after

Attachments:
Last edit: 11 years 11 months ago by karlvann. Reason: update pic

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

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #82344

Hi,

You just have to edit the view "product / listing_table" and add your needed columns, in the columns you have to put "$row->customFieldName". And it will display the value of the custom field of each product.

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

  • Posts: 37
  • Thank you received: 2
11 years 11 months ago #82401

I may be in over my head here but I guess the columns are here somewhere, I'm shop owner that is just basically winging it with no coding skills.

If it's not suitable to do this, thats ok I'll just put it in the commercial jobs section as I understand there has to be a limit to the support you provide..

		$columns = 1; ?>
		<table class="hikashop_products_table adminlist table table-striped table-hover" 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_product')){ ?>
						<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' &&

Last edit: 11 years 11 months ago by Jerome. Reason: using code tag

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 11 months ago #82518

That's the column name for the title "product":

<th class="hikashop_product_name title" align="center">
						<?php echo JText::_( 'PRODUCT' );?>
					</th>
But there is also the code for each value (the name of the product) which is:
<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>

So for example for the support custom field, you would have to add first a column title before the first piece of code I gave:
<th class="hikashop_support_title" align="center">support</th>

and then add the column value before the second piece of code I gave:
<td><?php echo $this->row->support; ?></td>

You have all the pieces. If you can't do it, I would indeed recommend to find a developer.

The following user(s) said Thank You: karlvann

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

  • Posts: 37
  • Thank you received: 2
11 years 11 months ago #82519

That should be fine now, This is perfect, thanks so much.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum