Knowledgebase:
Close up functionality Suivant Theme
Posted by , Last modified by on 30 April 2015 11:48 AM

Disclaimer

This will work for stores on Miva Version 9.0 or newer. Note that this will require making template changes. Make sure you make sure you are aware of what version was active before any changes are made. These edits are low-risk but if you feel uncomfortable with making these changes then we advise you to seek help from a developer. 


 

Issue

Clicking on the image results in an  ‘image could not be loaded’ message. 

 

 

Instructions

Make the following changes to the Product Display Layout Image Machine

 

Original:

<mvt:assign name="l.settings:clean:product:name" value="glosub(l.settings:product:name, asciichar(39), '&#39;')" />
<script>
var gallery = [],
thumbnailIndex = 0;

ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function (thumbnail_image, main_image, closeup_image, type_code) {
var thumbnail,
img;

thumbnail = document.createElement('div');
thumbnail.className = 'column one-third medium-one-fourth';
thumbnail.setAttribute('data-index', thumbnailIndex++);

if (typeof(thumbnail_image) == 'string' && thumbnail_image.length > 0) {
img = document.createElement('img');
img.src = thumbnail_image;
thumbnail.appendChild(img);
gallery.push({
src: closeup_image,
title: '&mvt:clean:product:name;'
});
};
return thumbnail;
};
</script>

 

Revised:

<mvt:assign name="l.settings:clean:product:name" value="glosub(l.settings:product:name, asciichar(39), '&#39;')" />
<script>
var gallery = [],
thumbnailIndex = 0;

ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function (thumbnail_image, main_image, closeup_image, type_code) {
var thumbnail,
img;

thumbnail = document.createElement('div');
thumbnail.className = 'column one-third medium-one-fourth';
thumbnail.setAttribute('data-index', thumbnailIndex++);

if (typeof(thumbnail_image) == 'string' && thumbnail_image.length > 0) {
img = document.createElement('img');
img.src = thumbnail_image;
thumbnail.appendChild(img);

};

gallery.push({
src: closeup_image,
title: '&mvt:clean:product:name;'
});

return thumbnail;
};
</script>

 

(0 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako support.miva.com/supportsuite/index.php?