[Skip to main content](#vessel-content)

#   Product Picture Link

##

- **[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")**
- [![ngt13's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7850-ngt13 "View ngt13's Profile") Topic Author
- [ Offline](/forum/user/7850-ngt13)

Less More

- Posts: 53
- Thank you received: 0
-
-

13 years 3 months ago [\#119898](#119898) by [ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")  *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#119898 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")* was created by *[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")*

Hi Guys

I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.

Can this be done and if so how can i do it?

Many Thanks

Nick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 3 months ago [\#119905](#119905) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#119905 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")*

Hi Nick,

This can be done by editing your listing view and adding some html code.
It's not really difficult and many people on the forum did it.
However, if you're not confident with coding, please give us a link to your website and we'll help you with it ![;)](/media/kunena/emoticons/24.png ";)")
You should also make sure that the "Link to the product page" option of your module/menu is enabled.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")**
- [![ngt13's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7850-ngt13 "View ngt13's Profile") Topic Author
- [ Offline](/forum/user/7850-ngt13)

Less More

- Posts: 53
- Thank you received: 0
-
-

13 years 3 months ago [\#119912](#119912) by [ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")  Replied by *[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")* on topic *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#119912 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")*

Thanks Eliot

I dont mind giving it a go. I think i have found the file in:

DISPLAY&gt;VIEWS&gt;TEMPLATE&gt;PRODUCT&gt;LISTING

What im not so sure about is what part of the code to edit? Also do i input the "add to cart html link" code?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 3 months ago [\#119962](#119962) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#119962 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")*

Hi,

Generally the file to edit is "product / show_default" via the menu Display &gt; Views of HikaShop.
This is the product page view, it's not the "listing" one.

You have to edit the code for the image, you can remove it and add a common html tag to display the image.
The image link is in the variable "$this-&gt;element", around this tag add the add to cart button html tag.
And you will have the images which are adding the product to the cart when clicking on it.

The code to replace is: Code:

//LAYOUT show_block_img $this-&gt;row = &amp; $this-&gt;element; $this-&gt;setLayout('show_block_img'); echo $this-&gt;loadTemplate();

And an example of the html link can be found in the toolbar of the product edition page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")**
- [![ngt13's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7850-ngt13 "View ngt13's Profile") Topic Author
- [ Offline](/forum/user/7850-ngt13)

Less More

- Posts: 53
- Thank you received: 0
-
-

13 years 3 months ago [\#120128](#120128) by [ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")  Replied by *[ngt13](/forum/user/7850-ngt13 "View ngt13's Profile")* on topic *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#120128 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")*

Hi Xavier

Thanks for the feedback. This is not working for me. Under "product/show_default" i can not find:
Code:

//LAYOUT show_block_img $this-&gt;row = &amp; $this-&gt;element; $this-&gt;setLayout('show_block_img'); echo $this-&gt;loadTemplate();

I only see this: Code:

$this-&gt;row = &amp; $this-&gt;element; $this-&gt;setLayout('show_block_img'); echo $this-&gt;loadTemplate();

At this point i have no idea where exactly to put the html add to cart code. Can you help?

Another question if i put this code in the universal product display, as the add to cart html code is product specific, if i add to cart for different products wont just one product be added to cart. How do i change this so the right product is added to cart when i click the product image? I hope this makes sense haha

Many thanks

Nick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 3 months ago [\#120176](#120176) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Product Picture Link](/forum/26-product-category-display/861315-product-picture-link#120176 "Hi Guys  I would like to link the product image on the product page to add to cart html link so if a user clicks the product image they add the product to the cart. Currently if you click the image a lighbox pops up and the larger image is displayed. I would like to turn this off completly and instead link the image.  Can this be done and if so how can i do it?  Many Thanks  Nick")*

You're at the right place.
Point is you need some good php skills before starting this because you will have to add some js code in order to add your product to the cart. You can get some inspiration from the function displayButton in the file cart.php of administrator/com_hikashop/helpers
As Xavier said you'll have to use the informations stocked in $this-&gt;element to create a dynamic code.
If it sounds to difficult for you, you can still ask on the Commercial Jobs forum ![:)](/media/kunena/emoticons/3.png ":)").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjEzMTUtcHJvZHVjdC1waWN0dXJlLWxpbms/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.060 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
