How to show category title in product list div.

  • Posts: 11
  • Thank you received: 0
11 years 4 months ago #154851

sorry. i'm try to search for solution. but i'm not see anything.

How can I show Category title under Product name in product list div?.

Thanks

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

  • Posts: 11
  • Thank you received: 0
11 years 4 months ago #154853

and can i'm show brand image on product list too?

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

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #154899

Category title:
You can copy the relevant code from view category/listing_img_title and insert it into product/listing__img_title where you want it - just without the part displaying the number of products in that category, I guess. The rest is CSS.

Brand image:
Very similar, it's the same views/files involved. I managed to display the brand image in a div a.k.a subcontainer or thumbnail with this code:

<div class="you-name-it">		
	<?php
		if($this->config->get('manufacturer_display', 0) && !empty($this->row->product_manufacturer_id)){
		$class = hikashop_get('class.category');
		$manufacturer = $class->get($this->row->product_manufacturer_id, true);
		global $Itemid;
		$categoryClass = hikashop_get('class.category');
		$categoryClass->addAlias($manufacturer);
		echo $this->image->display($manufacturer->file_path,false,$manufacturer->file_name, '', '', $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
	}
	?>
</div>
Insert in product/listing_img_title where it suits your div layout. The rest, like size and all, is again a matter of CSS.

It works for me. Should there be a better way, I'm sure the support team here will advise.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 11 years 4 months ago by lousyfool.
The following user(s) said Thank You: apatiu

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

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #154900

.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 11 years 4 months ago by lousyfool.

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

  • Posts: 11
  • Thank you received: 0
11 years 3 months ago #154947

Thank you very much now Brand image is showing by this code

if(!empty($this->row->product_manufacturer_id)){
		$class = hikashop_get('class.category');
		$manufacturer = $class->get($this->row->product_manufacturer_id, true);
		global $Itemid;
		$categoryClass = hikashop_get('class.category');
		$categoryClass->addAlias($manufacturer);
		echo $this->image->display($manufacturer->file_path,false,$manufacturer->file_name, '', '', $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
        }

if have
$this->config->get('manufacturer_display', 0)
it's not working. (Where can i set 'manufacturer_display' from menu.

but Category title not working by copy this to product/list_img-title
<span class="hikashop_category_name">
	<a href="<?php echo $link;?>">
		<?php

		echo $this->row->category_name;
		if($this->params->get('number_of_products',0)){
			echo ' ('.$this->row->number_of_products.')';
		}
		?>
	</a>
</span>

Can you have some reccomend for me?

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

  • Posts: 2143
  • Thank you received: 747
11 years 3 months ago #154951

Try this:

<?php $link = $this->getLink($this->row->category_id,$this->row->alias);?>
<span class="hikashop_category_name">
	<a href="<?php echo $link;?>">
		<?php
		echo $this->row->category_name;
		?>
	</a>
</span>


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
The following user(s) said Thank You: apatiu

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

  • Posts: 11
  • Thank you received: 0
11 years 3 months ago #154970

error on

<?php $link = $this->getLink($this->row->category_id,$this->row->alias);?>

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

  • Posts: 2143
  • Thank you received: 747
11 years 3 months ago #154976

Hmm, strange. Works for me. Sorry.

I give up, time for the officials here to take over. Might make sense if you added what the error message is.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 11
  • Thank you received: 0
11 years 3 months ago #155102

Thanks for your help.

i will try again. and be back again.

Thanks very much

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

Time to create page: 0.073 seconds
Powered by Kunena Forum