News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Category Picture linked to Product Details

Started by RedGelly, March 04, 2013, 08:22:16 AM

Previous topic - Next topic

RedGelly

Hello, I have this problem that I've been unable to solve for a few hours, so I decided to seek help.
I'm currently using Virtuemart 2.0.18a and yes, I know that the category pictures automatically links to the product details, but somehow it isn't working for me, it links to the picture instead.
I altered the category.php abit, like adding cart, etc. The product details.php as well as the default_images.php in the product details folder. They are all under /components/com_virtuemart/views.

This is the website I'm currently working on, www.uniquecon.com.sg, you can click on new arrivals to see the category layout page.
As you can see when you click on the image, the image comes up instead of the product details link. I've checked my overrides and it's all default besides the template layout. When I 'inspect element' under chrome, I can see that the product details link is called out, however at the same time the image link is there as well, which I figured that was probably what's wrong... I tried to replace the original category.php back but it's still the same... So I changed it back...

I'm at a loss of what to do, so I really hope someone here can help me.  :'(

jenkinhill

When you say "category.php" I assume you mean views/category/tmpl/default.php rather than one of the fore category.php files that exist in the VM core?

The code within the product image display div should be as shown below. Check that you have not included the image link from an older version of the default.php template.


    <a title="<?php echo $product->link ?>" rel="vm-additional-images" href="<?php echo $product->link?>">
<?php
echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false);
?>

</a>

<!-- The "Average Customer Rating" Part -->


You should be using the revised category display template file as override in your Joomla template's html/com_virtuemart/category/ directory, so if you rename that directory you can test without using overrides.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

RedGelly

Hello, thanks for much for the reply!

Sorry for the mix up, yes, I meant the default.php in the category folder under views.
I've tried what you've suggested and even copied and pasted your code into my default.php and placed the default.php in the /templates/ajt005_j30/html/com_virtuemart/category directory...
However, there was no change... Did I do something wrong here?  :-\

So far my configuration for category, product and homepage layout is set under 'default' and I haven't made any coding changes to the default.php. I really dunno what's wrong here... 


jenkinhill

You still have some junk code, somehow giving nested links. So your equivalent to the code snippet I quoted earlier is:


<a title="/index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=4&amp;virtuemart_category_id=4&amp;Itemid=524" rel="vm-additional-images" href="/index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=4&amp;virtuemart_category_id=4&amp;Itemid=524">
<a title="image-32" class='modal' rel='group' href="http://www.uniquecon.com.sg/images/stories/virtuemart/product/image-32.jpg"><img src="/images/stories/virtuemart/product/resized/image-32_300x400.jpg" alt="image-32" class="browseProductImage" /></a> </a>
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

RedGelly

Hello, thanks for the reply again!

Yes, I know about that, but is there a way to find out where the junk code is? Is it within the file, or could it be somewhere else? x.x
Because I altered other files as well and I'm not sure if it affects this one... So sorry for bothering you.  :-[