News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart 2.0.2 and Thumbnails Problem

Started by Federico, February 25, 2012, 13:49:43 PM

Previous topic - Next topic

Federico

Hello,

I've just updated to 2.0.2 version and found that the image scaling on product page does not work. It shows the enlarged image only and not the thumbnail.

Eg:
http://www.freeback.it/index.php/component/virtuemart/bigiotteria/bracciali/bracciale-alb01001-detail?Itemid=0

Joomla: 1.7.5 Stable
Virtuemart: 2.0.2
Db: 5.1.49-3
Php: 5.3.3-7+squeeze8

How to solve the problem?

Twix

I recommend first upgrading to Joomla 2.5.1. Joomla 1.7 is end of life.

vapro

add this line to vmsite-ltr.css

.medium-image { width:435px;}

of course set your width yourself



samsontumanyan

I do this`

IN file:
/components/com_k2/css/k2.css


Add on Line 30 in your k2.css

img {
    border: medium none;
    max-width: 100%;
}

If your site run using SSL (https:)

K2 SSL Fix




I responded in more detail on the other post Lefteris refers to (if you want more details and a better understanding, please visit that post), but long story short, I came up with a solution that can be used in your template to ensure that no components (K2 or otherwise) include non-secure dependencies on pages that you want to be secure. Here's the code:

// SSL fix to resolve issues with K2
if ( substr($this->base, 0, 5) == 'https' ) {
$head = $this->getHeadData();
// first, the stylesheets:
foreach($head['styleSheets'] as $link => $props) {
if (strpos($link, 'http:') !== false) {
$fixedLink = str_replace('http:', 'https:', $link);
$head['styleSheets'][$fixedLink] = $props;
unset($head['styleSheets'][$link]);
}
}
// then, the js:
foreach($head['scripts'] as $link => $props) {
if (strpos($link, 'http:') !== false) {
$fixedLink = str_replace('http:', 'https:', $link);
$head['scripts'][$fixedLink] = $props;
unset($head['scripts'][$link]);
}
}
$this->setHeadData($head);
}

Just put that snippet in your template (it shouldn't matter where you put it, but I find it helpful to put all php logic at the top of my templates, before the actual html markup; though regardless of where you put the code snippet, make sure it's in a <?php ?> block), and your secure pages will become secure once more.

And add this code in a your template component.php file

Regards, Samson Tumanyan

Federico

Hello,

Thank you for your answers.

I solved modifying default_images.php file, line 26:

from

<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', false, "class='modal'", true); ?>

to

<?php echo $this->product->images[0]->displayMediaFull('class="product-image" id="medium-image"', false, "class='modal'", true); ?>

I hope this will not cause other problems.

janis

this should be in the next version update i think..
Files:  http://dev.virtuemart.net/projects/virtuemart/files

Updates:
https://github.com/VirtueMart/virtuemart/commits/master


love virtuemart when it's 10000% stable like in version 4.5 in the year 2015