Brand image in product display

  • Posts: 30
  • Thank you received: 1
9 years 10 months ago #160235

-- url of the page with the problem -- : www.dadatecnologia.com/categorias/Productos/3-aastra-415.html
-- HikaShop version -- : HikaShop Starter 2.3.0
-- Joomla version -- : 3.3.0
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Google Chrome Versión 35.0.1916.114 m
-- Error-message(debug-mod must be tuned on) -- : No error

Hi, I have done this:
hikashop.com/forum/product-category-disp...he-product-view.html

I have paste that script in /components/com_hikashop/controllers/product.php and if I do that, I get a blank page in product display.

I would appreciate you tell me where should I paste it.

Thanks in advance

David

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #160236

Well, sorry to say this, but obviously you haven't done as suggested in the linked thread. To start with, you've picked an entirely wrong file which hasn't been mentioned once in the thread, and which isn't a "view" as should be. When you basically asked the same question a couple of days ago, Nicolas gave you the correct file to work on. So, this time you want to follow instructions and pick that file, please, otherwise it'll never work, and no one will be able to help you.

  1. If you haven't, yet, reverse everything you've done (seems you did, because I can see your product page).
  2. Always a good start: reading the documentation, here and now particularly hikashop.com/support/support/documentati...-display.html#layout
  3. In accordance with this documentation, in the correct file which you know now once and forever, and telling from where your brand name is now in your product page (assuming that's where you want the image), you will want to insert the code inside the div with the id "hikashop_product_right_part", following the span with id "hikashop_product_price_main", and just before the two br's.

Hint: How do I know where to insert the code? As mentioned just a bit earlier in that same page of documentation, Firebug is your friend, telling you where stuff is in your HTML/PHP code - hence, telling you where to alter existing or plant new code.

Good luck. Let us know when you're done! ;)


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: 30
  • Thank you received: 1
9 years 10 months ago #160507

Hi Lousyfool, you are right, I was wrong, I apologize.

As Nicolas told me in the first thread, I have pasted the script in the show_defalt view, but instead an image, I got the following:

string(44) "media/com_hikashop/upload/tripp_lite_ups.jpg"

You can see it here:
www.dadatecnologia.com/categorias/Productos/1-su1500xl.html

What am I doing wrong?

Thanks in advance

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #160508

Ha, guess you pasted only the code as per Xavier's post in that other thread? Well, as promised there, that'll give you the brand's image path, which you have now displayed there. Not the image... :silly:

Reverse it, delete it. The following code works for me, so it should work for you, too:

<div class="custom_brand_image">		
		<?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, 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>

Notes:
  • With where you've positioned it now in the code, should you ever decide to also display voting and pricing, those two will show up sort of in between the brand image and the line "Fabricantes: TRIPP LITE". I can't think of any reason why you'd want that, so re-think where to put it. Gave you a hint in my previous post here, but of course, it's your call. ;)
  • I've wrapped it into a div with class name "custom_brand_image", so you have some control over it per CSS. You might want to consider doing similar with the brand name/link for the same good reason.
  • The size of the image should be what you set for thumbnails in the backend system config. You could change it there unless you'd then be unhappy with the thumbnail size elsewhere... in which case you can still apply CSS. (Did I mention Firebug before...? B) )

Looking forward to your "Success!" post.


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: jdponce

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

  • Posts: 30
  • Thank you received: 1
9 years 10 months ago #160610

It works!
Yes, I have wrapped it as you said and the size is good... What can I say? this is an out of the box support.

Thanks a lot!

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #160611

Glad to hear! Where do I send the bill? :woohoo: :P :woohoo:


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: jdponce

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

  • Posts: 30
  • Thank you received: 1
9 years 10 months ago #160614

Hahahaha :-)

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

  • Posts: 103
  • Thank you received: 5
5 years 2 months ago #303845

I have to jump in here and hope someone can help me a bit her.

the brand image is setup so far on my product detail page - i placed the code in the "show_block_dimensions.php" file.
put i want to link it also to the brand page what i have setup, for that i have to call also the brand URL and surround the brand image with a html link code.

my code what i use right now is based on the code above this thread:

// modification - Show Manufacturer Image - START
if($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)){
	$class = hikashop_get('class.category');
	$categoryClass = hikashop_get('class.category');
	$manufacturer = $class->get($this->element->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, '', '', 100, 100);
}

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
5 years 2 months ago #303847

Hi,

You can change the line:

echo $this->image->display($manufacturer->file_path,false,$manufacturer->file_name, '', '', 100, 100);
to:
		$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
echo '<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$this->image->display($manufacturer->file_path,false,$manufacturer->file_name, '', '', 100, 100).'</a>';

The following user(s) said Thank You: n00bster

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

  • Posts: 103
  • Thank you received: 5
5 years 2 months ago #303854

is working perfect, thank you!

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
4 years 5 months ago #312714

Hello,

I don;t want the brand image to be displayed but want the brandname to be displayed in the product category view..
I places this code: <?php echo JText::_('MANUFACTURER').': '.'<a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid).'">'.$manufacturer->category_name.'</a>'; ?>
into the product/listing_img_title and only get this:
Merk:
After this the manufacturer category attached to this product is missing..
how can i get this here??
Please also see attachement.

Thanks

Attachments:

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
4 years 5 months ago #312715

Hi,

You first need to load the manufacturer/brand data from the database.
So you first need the code:

	$class = hikashop_get('class.category');
	$manufacturer = $class->get($this->row->product_manufacturer_id, true);

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

Time to create page: 0.113 seconds
Powered by Kunena Forum