Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0 - Fix for Magnific.js product image popup #1105

Closed
villagedefrance opened this issue Dec 27, 2013 · 1 comment
Closed

v2.0 - Fix for Magnific.js product image popup #1105

villagedefrance opened this issue Dec 27, 2013 · 1 comment

Comments

@villagedefrance
Copy link

First > Create a "magnific" folder under "catalog\view\javascript\jquery".

Second > Place "magnific.css", magnific.js" and "magnific.min.js" inside it.

Third > Edit controller "product.php" with :
$this->document->addScript('catalog/view/javascript/jquery/magnific/magnific.min.js');
$this->document->addStyle('catalog/view/javascript/jquery/magnific/magnific.css');
(Note: "magnific.min.js" is required, as "magnific.js" doesn't seem to be working)

Fourth > Edit template "product.tpl" with this script at the bottom :

$(document).ready(function() {
$('.thumbnail').magnificPopup({
type: 'image',
gallery: { enabled:true },
retina: {
ratio: 2,
replaceSrc: function(item, ratio) {
return item.src.replace(/.\w+$/, function(m) { return '@2x' + m; });
}
}
});
});

(Note: this code includes support for Retina images but only works if a second image at High Definition (@2x) is present, as per Retina setup rules.)

That's it !

@danielkerr
Copy link
Member

fixed in latest commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants