Manufacturer and extra fields display in listing

  • Posts: 59
  • Thank you received: 0
11 years 4 weeks ago #129645

is it possible to display product manufacturer and certain extra field (one or two) in products listing? link on listing: activeaction.ru/katalog/gornyie-lyizhi.html

and how to change name of the listing to category name?

i hope this picture can help you to help me :blush:

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 weeks ago #129648

There is no easy option to do that.
You would have to create custom product fields and then edit the file "listing_img_title" of the view "product" to add custom code to display them:
www.hikashop.com/forum/4-how-to/59726-ad...g-img-title-php.html

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

  • Posts: 59
  • Thank you received: 0
11 years 4 weeks ago #129742

Thank you! it was easy and it works. but how i can display manufacturer of the product in listing?

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

  • Posts: 59
  • Thank you received: 0
11 years 4 weeks ago #129743

and, meybe you know how it's to NOT display this field, if empty?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 weeks ago #129835

Sure you'll just have to use some code like this :

<?php 
if(!empty($this->row->CUSTOM_FIELD_COLUMN))
echo $this->row->CUSTOM_FIELD_COLUMN; 
?>

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

  • Posts: 59
  • Thank you received: 0
11 years 3 weeks ago #129856

how i can display manufacturer of the product in listing?

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

  • Posts: 59
  • Thank you received: 0
11 years 3 weeks ago #129861

i have this code, but it is not working

<div class="hikashop_product_manufacturer">		
<?php
		if($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)){
	$class = hikashop_get('class.category');
	$manufacturer = $class->get($this->element->product_manufacturer_id);
	global $Itemid;

	$categoryClass = hikashop_get('class.category');
	$categoryClass->addAlias($manufacturer);
	echo JText::_('MANUFACTURER').': '.'<a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid).'">'.$manufacturer->category_name.'</a>';
}
?>
</div>

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 weeks ago #130163

Hi,

Try to use $this->row instead of $this->element.

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

  • Posts: 59
  • Thank you received: 0
11 years 3 weeks ago #130441

it's work great, thank you.one more question: i have specific extra field in one or two categories. i use this code:

<?php if (!empty($this->row->rostovkaobsh)) { echo '<div class="hikashop_product_extrafieldrost"><b>Ростовка:</b> '.$this->row->rostovkaobsh.'</div>'; } ?>

but it isn't work perfect -
<b>Ростовка:</b>
displayed always, even extra field isn't displayed. how to fix this?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 weeks ago #130492

the best way to do that would be to use the code which will display all you have in your variable :

var_dump($this->row);
Then you'll be able to see what you have in your variable, and display what you want :).

Last edit: 11 years 3 weeks ago by Mohamed Thelji.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum