Delete product main image link

  • Posts: 61
  • Thank you received: 1
10 years 1 month ago #211006

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 2.4.3

I'm looking for a way to delete the image link on the product page?
Googles Inspect element feature shows that the a href is in the div.hikashop_product_main_image.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #211008

Hi,

You will have to edit some code in the view "product / show_block_img".
www.hikashop.com/support/documentation/1...ize-the-display.html

The following user(s) said Thank You: Digiwacht

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

  • Posts: 5
  • Thank you received: 0
9 years 10 months ago #219444

Hello.

I have been trying to accomplish this inside the file --> /components/com_hikashop/views/product/tmpl/show_block_img.php

But I have not been able to eliminate link inside the image.

Here is the code I see. Can you please help me and be more specific what I need to change?

Thanks a lot.

<div style="position:relative;text-align:center;clear:both;<?php if(!empty($divWidth)){ echo 'width:'.$divWidth.'px;'; } ?>margin: auto;" class="hikashop_product_main_image_subdiv">

						<?php

							if($this->image->override) {

								echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width,  $height);

							} else {

								if(empty($this->popup))

									$this->popup = hikashop_get('helper.popup');

								$image_options = array('default' => true,'forcesize'=>$this->config->get('image_force_size',true),'scale'=>$this->config->get('image_scale_mode','inside'));

								$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);

								if(@$img->success) {

									$attr = 'title="'.$this->escape(@$image->file_description).'"';

									if (!empty ($this->element->images) && count($this->element->images) > 1) {

										$attr .= 'onclick="return window.localPage.openImage(\'hikashop_main_image'.$variant_name.'\', \''.$variant_name.'\', event);"';

									}

									$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';

									if(!empty($this->element->badges))

										$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);



									echo $this->popup->image($html, $img->origin_url, null, $attr);

								}

							}

						?>

						</div>

Last edit: 9 years 10 months ago by luisposselt84.

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

  • Posts: 84312
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219456

Hi,

You want to change the line:
echo $this->popup->image($html, $img->origin_url, null, $attr);
to:
echo $html;

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

  • Posts: 5
  • Thank you received: 0
9 years 10 months ago #219478

Thanks a lot that solved the problem.

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

  • Posts: 5
  • Thank you received: 0
9 years 10 months ago #219479

I do have another question.

If you notice when we add more pictures some thumbnails are going to show up down below.

See picture one.



When I hover over the pictures they change but when I click on them the shadowbox appear.



One of the reasons I did not like the link on the main picture was because I had the shadowbox but now I have it inside the thumbnails.

How I can eliminate the link or the shadowbox?

Attachments:

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

  • Posts: 84312
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219483

Hi,

For the small images, it basically the same change.
You want to change the code:

if(empty($variant_name)) {
	echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
} else {
	echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image_VARIANT_NAME'));
}
to:
if(empty($variant_name)) {
	echo $html;
} else {
	echo $html;
}
in that same view file.

Last edit: 9 years 10 months ago by Jerome.

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

  • Posts: 5
  • Thank you received: 0
9 years 10 months ago #219594

Yes I actually did that but there is a problem.

Now the images are not clickable.

As a result the other thumbnails are not displayed on the top when I hover over them.

Attachments:
Last edit: 9 years 10 months ago by luisposselt84.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
9 years 10 months ago #219612

Hi,

You also need to replace

$attr = 'title="'.$this->escape(@$image->file_description).'" onmouseover="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
$html = '<img class="'.$classname.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
By
$attr = 'title="'.$this->escape(@$image->file_description).'" onmouseover="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
$html = '<img class="'.$classname.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'" '.$attr.'/>';
So you'll keep to "onchange" javascript code in the page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 9 years 10 months ago by Jerome. Reason: fix the wrong copy-paste

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

  • Posts: 5
  • Thank you received: 0
9 years 10 months ago #219756

@Jerome

Hello Jerome.

The only change I found inside the code you gave me was the title at the end.

This

'.$title.'/>

So I don't understand how that small change will keep the "onchange" javascript working.

I tested but not working.

Thanks for your time.

Last edit: 9 years 10 months ago by luisposselt84.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
9 years 10 months ago #219757

Hi,

I fixed my message for the wrong copy-paste.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 56
  • Thank you received: 2
9 years 4 months ago #240086

HI Nicolas:

I know this thread is old, but I trying to do something very similar.
Except I want to keep the popup on the main image.
But when I try to do so, I lose the ability to scroll through all the images as the arrows won't appear .
(most likely because it isn't referencing the thumbnails)
The code is a bit complex and it hard to know hat is going on, so I haven't been able to figure it out myself.

So here's what I managed to do so far:
So my thumbnails now change the main image - and I changed the onmouseover to onclick, and that all works.

$attr = 'title="'.$this->escape(@$image->file_description).'" onclick="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
							
$html = '<img class="'.$classname.' '.$thumbStyle.'" '.$attr.' alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';

echo $html;

When I click on the main image though, It does popup, but it only fetches the first image.
So there are no arrows to scroll through the gallery of images anymore.
(see attachement)

SO , if I switch the thumbnail code back to the original, it works.
From this:
echo $html;
BAck to this:
if(empty($variant_name)) {
	echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
} else {
	echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image_VARIANT_NAME'));
}

But of course if I do that, th e popups appear when I click the thumbnails, which I don't want.
Any idea how I might get it work ?

Thanks in advance.

Attachments:
Last edit: 9 years 4 months ago by vseva. Reason: cleaned up code block

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

  • Posts: 84312
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #240126

Hi,

I'm not sure of what you're trying to do.
The subject of this thread is:

I'm looking for a way to delete the image link on the product page?

And you said:

I know this thread is old, but I trying to do something very similar.
Except I want to keep the popup on the main image.

So you don't want to do what this thread is all about in the first place.


Regarding your question about the popup and the next/previous buttons:
The next/previous buttons are generated automatically based on all the images with a popup link on them in the same group on the page.
So if you remove the popup link from the small thumbnails and only keep it on the main image, it's normal that you loose the next/previous buttons in the popup since you remove what the system base itself on to do the next/previous buttons.
So if that's your question, I don't see a solution since you want to remove something which is use for something that you want to keep. The library we use to handle that system doesn't support that so it would basically require coding your own popup display system from scratch.

The following user(s) said Thank You: vseva

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

Time to create page: 0.117 seconds
Powered by Kunena Forum