Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Any way to make the thumbnail non-clickable?
Tagged: thumbnail
- This topic has 16 replies, 6 voices, and was last updated 10 years, 7 months ago by admin.
-
AuthorPosts
-
June 25, 2011 at 3:34 pm #3655JimmyMember
My original image is the same size as the thumbnail so I don’t want people to be able to click it expecting to see a larger version.
How would I remove the link or make the thumbnail non-clickable?
Thanks very much,
Jimmy
June 26, 2011 at 12:10 am #33671wpCommerceModeratorYou will have to tweak the code to do that.
For Fancy1 and Fancy2 Display
Open the “eStore_button_display_helper.php” file and look for the following line:
$output .= '<a href="'.$ret_product->thumbnail_url.'" rel="lightbox" title="'.$ret_product->name.'"><img class="thumb-image" src="'.$thumb_img.'" alt="'.$ret_product->name.'" /></a>';
Just take the link out so it is just a plain image. Basically make the above line look like the following:
$output .= '<img class="thumb-image" src="'.$thumb_img.'" alt="'.$ret_product->name.'" />';
For Rest of the Fancy Displays
The rest of the fancy displays come from the extra shortcodes plugin so you need to modify that plugin. Open the “eStore_extra_product_display_helper.php” file from the eStore extra shortcodes plugin and search for the following line of code:
$output .= '<div id="lightbox"><a href="'.$ret_product->thumbnail_url.'" rel="lightbox" title="'.$ret_product->name.'"><img src="'.$thumb_img.'" alt="'.$ret_product->name.'" /></a></div>';
Once you find it change it to the following:
$output .= '<img src="'.$thumb_img.'" alt="'.$ret_product->name.'" />';
June 26, 2011 at 12:12 am #33672amin007ParticipantYou can specify a URL value (the URL of this product page) in the “Thumbnail Target URL” field which will make it go to that product page and not the image itself. Let me know if that helps.
June 26, 2011 at 6:26 pm #33673JimmyMemberHey thanks very much for the help!
I really appreciate it-
Jimmy
June 26, 2011 at 7:27 pm #33674JimmyMemberDoesn’t seem to be working-
I changed the line in “eStore_button_display_helper.php” to this:
$output .= ‘<img class=”thumb-image” src=”‘.$thumb_img.'” alt=”‘.$ret_product->name.'” />’;
I’m still able to click the image.
I even cleared my cache and disabled/re-enabled the plugin.
The line that I changed is still there without the link part…
one thing I noticed:
At the top of the wordpress plugin editor it reads:
Editing wp-cart-for-digital-products/eStore_button_display_helper.php (inactive)
Does that (inactive) mean anything?
Here’s a link to one of my product pages: [http://thingswitheyes.com/penguin-erasers]
Thanks again,
Jimmy
June 26, 2011 at 11:56 pm #33675amin007ParticipantYou are using fancy5 which comes from the extra shortcodes plugin so you need to modify a file from that plugin. I have updated wpCommerce’s post to cover both scenerios. Please take a look at the 2nd post in this thread.
June 27, 2011 at 3:55 pm #33676JimmyMemberThanks again for the help!
That worked-
Cheers!
Jimmy
July 9, 2013 at 3:28 am #33677DanMemberI”m using fancy 11 so I edited “eStore_extra_product_display_helper.php” as per instructions on second part of the second post on this thread but still see the popups.
I noticed this post is over 2 yesrs old so has the code changrd at all?
thanks
July 9, 2013 at 11:55 pm #33678adminKeymasterSome of these fancy product templates were added later so they use a slightly different method.
Do the following for fancy 10, 11, 12 and 13 to make the thumbnail not clickable.
Open the “shortcode_include.php” file and search for the following line of code to find where the thumbnail images are being displayed:
<img src="'.$thumb_img_src.'" alt="'.$ret_product->name.'" />
Now, delete the full line and replace it with the following code (that will get rid of the link and only place the image by itself):
$output .= '<img src="'.$thumb_img_src.'" alt="'.$ret_product->name.'" />';
There will be multiple occurrences of this in the file so make sure to do the same for all of them.
July 10, 2013 at 1:01 pm #33679DanMemberHi,
I just did this and it in all 4 occurrences but it caused an error 500 on my server so had to reinstall plugin.
Can you please double check the code to make sure it’s sound.
If that’s the case then It’s me who did something wrong.
Thanks again
July 10, 2013 at 1:19 pm #33680DanMemberyep. tried again but same issue.
It was actually 6 ocurrences after all.
Please advise.
Thanks
July 11, 2013 at 2:25 am #33681adminKeymasterI just tested the code and it works correctly, so some code is going wrong when you are tweaking it. I am going to give you another instruction which may work better.
Open the “shortcode_include.php” file and go to the “show_wp_eStore_fancy11” function in that file.
Now find the block of code between the following two lines:
$output .= '<div class="eStore-thumbnail-fancy-11">';
......
$output .= '</div>';Once you find that, replace it with the following:
$output .= '<div class="eStore-thumbnail-fancy-11">';
$output .= '<img src="'.$thumb_img_src.'" alt="'.$ret_product->name.'" />';
$output .= '</div>';July 15, 2013 at 3:35 pm #33682DanMemberWorked perfectly.
Thanks for all the support
February 8, 2014 at 6:22 pm #33683celaviMemberHi all,
Great information here… and these tweaks have helped me to remove the link to a product image that was the same size as the thumbnail.
However, now I have a mix of products where some are just thumbnails that should not link to anything, while other products will need to link to a dedicated product page.
Any solution for this situation?
Thank you!
February 8, 2014 at 11:03 pm #33684adminKeymasterWhen you change the code, it will do it for everything (not just for some products).
Try using the following field of the product to specify a target URL for some products.
Thumbnail Target URL
-
AuthorPosts
- You must be logged in to reply to this topic.