ALT IMG option in characteristics

  • Posts: 85
  • Thank you received: 0
8 years 11 months ago #250833

-- HikaShop version -- : 2.6.4

I made a lot of characteristics (name field), but I would like to display the img alt option like
<img src=" www.fegyvernepper.com/images/sampledata/mintak/acu.png " alt="ACU" />

or OnMouseHover or something with I can display the name of pattern.

There is any solution?

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
8 years 11 months ago #250850

Hello,

A solution can be to create an override view on your "show_block_img" in Components => HikaShop => Configuration, in Display dropdown select Views.
Then, use the three filters dropdown with : Product, your frontend template, and frontend.
Find the show_block_img view and click on it to edit it.

Around line 60, change this :

...
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))
...
For this :
...
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="ACU" src="'.$img->url.'"/>';
									if(!empty($this->element->badges))
...

Hope this will fit your needs.

Regards

Last edit: 8 years 11 months ago by Philip.

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

  • Posts: 85
  • Thank you received: 0
8 years 11 months ago #250915

Thank you for yout help. I find the right rows in the show_block_img.

I tried to replace the code without any effect. The ALT parameter did not display when I move the mouse over the image.

Attachments:
Last edit: 8 years 11 months ago by palee3.

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #250944

Hi,

Philippe's information was to add an ALT tag to the main image of your products. So it's not what you want to do as far as I understand.

Adding the alt in the values of your characteristics should be enough to get it to be used by your browser.
Can you provide a link to that page ?

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

  • Posts: 85
  • Thank you received: 0
8 years 11 months ago #250999

The HikaShop is not published yet, but I can give you a frontend and/or backend access in private message.

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #251034

Hi,

Hi,

You can use our contact form along with a link to this thread:
www.hikashop.com/support/contact-us.html

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

  • Posts: 85
  • Thank you received: 0
8 years 11 months ago #251191

I wrote an email in related another issue with the login credentials.

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #251275

Hi,

It's normal that it's like that.
It's the title of the image that you want to fill with what will be in the popup when you over on the image, which is called a tooltip actually. The ALT tag is used for when the image can't be displayed or for the SEO.
The title is empty for all your images and that's why you don't get any tooltip on your images.

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

  • Posts: 85
  • Thank you received: 0
8 years 11 months ago #251285

Thank you, I will modify the patterns with the right parameter.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum