- Posts: 59
- Thank you received: 0
Manufacturer and extra fields display in listing
12 years 11 months ago #129645
by Dodesign
Manufacturer and extra fields display in listing was created 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:
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.
12 years 11 months ago #129648
by nicolas
Replied by nicolas on topic Manufacturer and extra fields display in listing
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
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.
12 years 11 months ago #129742
by Dodesign
Replied by Dodesign on topic Manufacturer and extra fields display in listing
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.
12 years 11 months ago #129743
by Dodesign
Replied by Dodesign on topic Manufacturer and extra fields display in listing
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 11 months ago #129835
by Mohamed Thelji
Replied by Mohamed Thelji on topic Manufacturer and extra fields display in listing
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.
12 years 11 months ago #129856
by Dodesign
Replied by Dodesign on topic Manufacturer and extra fields display in listing
how i can display manufacturer of the product in listing?
Please Log in or Create an account to join the conversation.
12 years 11 months ago #129861
by Dodesign
Replied by Dodesign on topic Manufacturer and extra fields display in listing
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.
12 years 11 months ago #130163
by Xavier
Replied by Xavier on topic Manufacturer and extra fields display in listing
Hi,
Try to use $this->row instead of $this->element.
Try to use $this->row instead of $this->element.
Please Log in or Create an account to join the conversation.
12 years 11 months ago #130441
by Dodesign
Replied by Dodesign on topic Manufacturer and extra fields display in listing
it's work great, thank you.one more question: i have specific extra field in one or two categories. i use this code:
but it isn't work perfect -
displayed always, even extra field isn't displayed. how to fix 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 -
Code:
<b>Ростовка:</b>
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 11 months ago - 12 years 11 months ago #130492
by Mohamed Thelji
Replied by Mohamed Thelji on topic Manufacturer and extra fields display in listing
the best way to do that would be to use the code which will display all you have in your variable :
Then you'll be able to see what you have in your variable, and display what you want
.
Code:
var_dump($this->row);
Last edit: 12 years 11 months ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
Time to create page: 0.242 seconds