Click on Image to Enlarge Text Under Thumnail

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
12 years 2 months ago #62302

I would like to add a line of text below the thumbnails on the product page; Click To Enlarge. Where can this be achieved please?

Thanks

Dave B)

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

  • Posts: 12953
  • Thank you received: 1778
12 years 2 months ago #62345

Hello,

You can do it by editing your "show_default" file of the "product" view of your front-end template that your are currenctly using through "Hikashop->Display->Views".
Hope this will help you.

The following user(s) said Thank You: davec

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #85109

Hi, I'd like to create captions for product images for a t-shirt website, specifying the name of the model with a link to their site or profile. How can I achieve this? Thanks :)

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #85235

Hi,

Where do you want to add these images ?

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #85243

Ideally, I want it overlaid on the image itself, both on the main product page and in the lightbox popup.

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

  • Posts: 2334
  • Thank you received: 403
11 years 10 months ago #85395

Hi there,

Could you precise if you a watermarking or an overlaid? It's two different things and it depend of what you're looking to achieve.
By the way, where did you specified the datas? I mean the link to the site/profile?
In every case it will require some coding notions :)

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

  • Posts: 55
  • Thank you received: 0
11 years 9 months ago #85682

Hey! Here's a link to a relevant page: whatsupclothing.com/newstore/product/45-.../category_pathway-15

As you will see, I have a custom field for the Model name, but it isn't what I'm looking for in this case so i will remove it.

I also have a tab with the details of the models and the link to their profile page: this is all the info I need, but I wish to have it placed over the image as an overlaid div.

I believe I need to simply use z-index and create a div, within which I can put the Name of Model as a link pointing to their modelling profile page. Once I have the basic html set up I may play around with the styles etc, but that's all I need to begin with.

I figure I need a custom field to provide the info to make the div. This is where I'm getting lost. I imagine I need something similar to this code, but calling the Name of Model value that I will input via custom field instead of the second '$this->element->product_url':

<span id="hikashop_product_url_main" class="hikashop_product_url_main">
<?php
if (!empty ($this->element->product_url)) {
echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');
}
?>
</span>

I did try to adapt this code to make it work for me but I'm not good enough with php to know what to replace this '$this->element->product_url' in the second part so that it renders the Title (Name of Model) rather than the url itself. I guess this is where the custom field comes into play, but how do I link them together in the code?

Another thing - on the page I linked you to, the main image popup has 9 images, despite the product having only 2. I deleted images I had added and readded them... Now that I write this I think I must need to delete the thumbnails, I'll try that and get back if it doesn't work. thanks :)

Last edit: 11 years 9 months ago by jen168.

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 9 months ago #85739

Hi,

You can display the value of a custom field like that:

<?php echo $this->element->CUSTOM_FIELD_COLUMN_NAME; ?>

So if you have two custom fields, one for the link called "link", and one for the name called "name", you can use that code:
<div class="your_css_class">
<a href="<?php echo $this->element->link; ?>" target="_blank"><?php echo $this->element->name; ?></a>
</div>

The solution for the images issue is explained in the documentation:
www.hikashop.com/en/support/documentatio...-player.html#install
As you can see, you simply need to remove two lines of code in a view file.

The following user(s) said Thank You: jen168

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

  • Posts: 55
  • Thank you received: 0
11 years 9 months ago #87271

Hi, can you tell me where the custom fields entries are stored in the database? The table hikashop_entry does not contain any data... and I can't find any other table with any data that looks relevant. I am attempting to change the value of one custom field, and it refuses to change on ther front end although it changes on the backend ( whatsupclothing.com/newstore/product/45-.../category_pathway-15 ). Any ideas? Thanks

PS I have removed the 2 lines of code as specified above, but I still have 3 images instead of 2. I guess it counts the main image then both thumbnails too? Either way, I would prefer not to have this problem. Thx :)

Last edit: 11 years 9 months ago by jen168.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #87380

Hi,

The custom fields are created on the product table if the custom field is for the products, etc.
So you have to edit the table "#__hikashop_product".

For the images, have you set an image for a vairant ?
You can maybe try to edit the object "$this->element->images" in the view "product / show" to remove the first element.

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

  • Posts: 55
  • Thank you received: 0
11 years 9 months ago #87425

Thanks.... this is really strange. I have changed the value in 3 different products and the only problem is with the 1st one I tried to change. In the database and in the backend it shows the correct value, but in the frontend it shows the incorrect old value. I have emptied the cache, and even unpublished the custom fields and republished them. I can't think what else could be causing this behaviour. Please help, it's really annoying!

Secondly, the product variants don't have images set. I can try with that but I don't see what difference it would make. I just have 2 images per product, both set to the main product so that's what needs to be fixed... it obviously counts the main image separately from the 2 thumbnails below.

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 9 months ago #87698

If the value is changed in the database, there is no reason besides a caching issue that you don't see it on the frontend.

I'm guessing that the problem could be a simple mistake in your code like for example if you're not using the correct column name or something.

The three images count is normal : the main image and then each thumbnail. There is no easy way to change that unfortunately.
The fix I proposed is to avoid counting the images for each variant and thus getting 5 images in the popup instead of 3.

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

  • Posts: 55
  • Thank you received: 0
11 years 9 months ago #88125

Thanks. I have caching disabled, and the same code is being used across all products... When I changed the value of the custom fields of any other product, it immediately changes on the frontend. It's just one product that refuses to do so.

I'm going to try and figure it out today. However, can I give you my backend login details, so that if one of you has some time you could maybe have a look?? Thanks in advance....! :)

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

  • Posts: 55
  • Thank you received: 0
11 years 9 months ago #88132

EDIT - I ended up just deleting the product and creating it again. Not ideal... but the problem does not seem to be re-occurring. Glitch in the matrix, I guess.....

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

Time to create page: 0.114 seconds
Powered by Kunena Forum