Skip to main content

Manufacturer and extra fields display in listing

13 years 1 week ago #129645 by Dodesign
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:

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

13 years 1 week ago #129648 by nicolas
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.

13 years 1 week ago #129742 by Dodesign
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.

13 years 1 week ago #129743 by Dodesign
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.

13 years 1 week ago #129835 by Mohamed Thelji
Sure you'll just have to use some code like this :
Code:
<?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.

13 years 6 days ago #129856 by Dodesign
how i can display manufacturer of the product in listing?

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

13 years 6 days ago #129861 by Dodesign
i have this code, but it is not working
Code:
<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.

13 years 5 days ago #130163 by Xavier
Hi,

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

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

13 years 3 days ago #130441 by Dodesign
it's work great, thank you.one more question: i have specific extra field in one or two categories. i use this code:
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 -
Code:
<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.

13 years 3 days ago - 13 years 3 days ago #130492 by Mohamed Thelji
the best way to do that would be to use the code which will display all you have in your variable :
Code:
var_dump($this->row);
Then you'll be able to see what you have in your variable, and display what you want :).
Last edit: 13 years 3 days ago by Mohamed Thelji.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum