[Solved] Remove the image link and link to product.

GK User
Sat Mar 10, 2012 10:15 am
When i'm in Virtuemart - http://aleksandrshevchenko.org/store/category/sermons -

Clicking on the product image brings up a bigger image in shadowbox - it's kinda not needed.. instead a USER would rather want to be directed to the VM product page of that item. How can i override that?

Currently only clicking the title will get you the the VM product page fo that item. I'd like to override the image link and instead direct the user to VM product page of that item.

Thank you for you help.
User avatar
Expert Boarder

GK User
Sat Mar 10, 2012 9:24 pm
Did you find solution ?
User avatar
Gold Boarder

GK User
Sun Mar 11, 2012 3:00 am
not yet... still waiting for someone to help me...
User avatar
Expert Boarder

GK User
Sun Mar 11, 2012 1:51 pm
any ideas?
User avatar
Fresh Boarder

GK User
Mon Mar 12, 2012 8:40 pm
I found something on virtuemart forum, but it is not working for me, maybe you will have more luck : http://forum.virtuemart.net/index.php?t ... #msg299146

And tell us here the result.
User avatar
Gold Boarder

GK User
Tue Mar 13, 2012 11:29 pm
no luck yet. still trying though. maybe gavick will be able to help us. I dont' know if it's part of the template or not.
User avatar
Expert Boarder

GK User
Wed Mar 14, 2012 3:07 am
What does it do: While in category view page clicking on product images takes you to product details page.
Find File: \templates\gk_esport\html\com_virtuemart\category\default.php
Find Lines: 195 to 197 which is below
Code: Select all
               <?php /** @todo make image popup */
                     echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
                  ?>

Replace it with below
Code: Select all
                <a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>


See you around...
User avatar
Platinum Boarder

GK User
Wed Mar 14, 2012 6:51 am
can i somehow do this with an override? so updates for break it.. or do i have to write this down and just change it after every update?
User avatar
Expert Boarder

GK User
Wed Mar 14, 2012 6:52 am
I am afraid you have to write it down as we cannot override php code.

See you around...
User avatar
Platinum Boarder

GK User
Wed Mar 14, 2012 7:23 am
ok.. i already wrote it down.. :) As it does work.. :)

but it doesn't work here: http://aleksandrshevchenko.org/store in this section ПОСЛЕДНИЕ ПОСТУПЛЕНИЯ

what do i edit here? thank you.
User avatar
Expert Boarder

GK User
Wed Mar 14, 2012 7:32 am
Seems like this works..


Find lines: 45 to 49 in gk_esport/html/com_virtuemart/virtuemart/default_products.php

Replace:

Code: Select all
<?php // Product Image
               if ($product->images) {
                  echo JHTML::_ ( 'link', JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id ), $product->images[0]->displayMediaThumb( 'class="featuredProductImage" border="0"',true,'class="modal"' ) );
               }
               ?>


With Same code:

Code: Select all
<a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>



Let me know if this is correct.
User avatar
Expert Boarder

GK User
Wed Mar 14, 2012 7:49 am
Yes you can use that, although try it with a product that doesn't have an image to see what happens for test purposes. See you around.
User avatar
Platinum Boarder

GK User
Wed Mar 14, 2012 3:44 pm
ffministry wrote:Seems like this works..


Find lines: 45 to 49 in gk_esport/html/com_virtuemart/virtuemart/default_products.php

Replace:

Code: Select all
<?php // Product Image
               if ($product->images) {
                  echo JHTML::_ ( 'link', JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id ), $product->images[0]->displayMediaThumb( 'class="featuredProductImage" border="0"',true,'class="modal"' ) );
               }
               ?>


With Same code:

Code: Select all
<a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>



Let me know if this is correct.


It is perfect, thanks.
User avatar
Fresh Boarder

GK User
Thu Apr 05, 2012 5:27 am
Marking this as solved. Following is added for reference and for search purposes.

Virtuemart change product image link to product details page.
Virtuemart change frontpage products image link to product page.

See you around...
User avatar
Platinum Boarder


cron