News:

Support the VirtueMart project and become a member

Main Menu

Pop up on product category image rather than link to product[SOLVED]

Started by bigrich66, October 26, 2012, 16:40:23 PM

Previous topic - Next topic

bigrich66

(Joomla 2.5.7 VM 2.0.12f)

Hi

Is it possible to enable a pop up on a product category image rather than it linking to the products. I'm building a website to sell self assembly kitchen so its important the product category image for a kitchen can be enlarged before a user decides to buy the products associated with that kitchen.

There is a worded link under the image to get to the products page so the user doesn't really needed the image to link to the products page too.

The kitchen product category images that I'd like to turn into a pop ups are below.

http://mvs103-013.directrouter.co.uk/~tradeki/store/traditional

Many Thanks

bytelord

Hello,

The following is for category view and not for front page. As i see you are using template overrides so you have to edit the category view files under your_joomla_folder/templates/dj-furniture-store/html/com_virtuemart/category/default.php

around line 109 is where the image is been displayed. The code is like the following:

<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br/>
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb (""FALSE);
//} ?>

</a>
</h2>


Change with the following one:

<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
         <?php echo $category->category_name ?> </a>
<br/>
<?php // if ($category->ids) {
        
echo $this->category->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' $category->category_name '" 'TRUE'class="modal"');
//} ?>

</h2>


We use the css class browseProductImage but all the rest is for category view. This one will work exactly as you wish.
You can modified as you wish to your custom template.

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bigrich66

Many thanks bytelord,

The pop up is working which is great, however the page is now displaying the image of the parent category(modern) for every child category rather than displaying the child category image. ie now have the same image rather than its own image

Cheers

bytelord

Hello,

Yes i have a mistake over there, sorry for that, i was hasty :) i place a $this->category, instead of $category inside the loop, so right one at the same line should be

<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
         <?php echo $category->category_name ?> </a>
<br/>
<?php // if ($category->ids) {
        
echo $category->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' $category->category_name '" 'TRUE'class="modal"');
//} ?>

</h2>


This will work fine echo $category instead of $this->category, which is the parent... let me know if everything is ok now.

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bigrich66


bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!