Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: image.elevateZoom is not a function: Failure in Magento 1.9 RWD theme

In Magento 1.9 CE, if we browse the product reviews page, it displays an error

TypeError: image.elevateZoom is not a function

This is because, magento is zooming image in product page using this plugin

the JavaScript interpreter, because of a failure shuts down on this page, JavaScript is not executed. This leads to decreased functionality of the page.

Can anyone help me on how to remove this error so that I can use js on this page?

These guys say they have solved the problem, but I can't get the solution.

I have asked the same question on Magento Stack.

like image 977
Haris Avatar asked Jul 09 '14 06:07

Haris


3 Answers

I've got the same issue - not that it's a complete solution but it certainly stops the error for now, by stopping the function being called on the review page.

in the file /skin/frontend/rwd/default/js/app.js

line 649 change

image.elevateZoom();

to

if ($('.review-product-list').length == 0) {
image.elevateZoom();
}
like image 147
Ricky Odin Matthews Avatar answered Oct 16 '22 08:10

Ricky Odin Matthews


We just ran across this for a client. This was resolved by changing the script being referenced from the min version to the full version. So replace this:

<action method="addItem"><type>skin_js</type>   
  <script>js/lib/elevatezoom/jquery.elevateZoom-3.0.8.min.js</script>
</action>

With this:

<action method="addItem"><type>skin_js</type> 
  <script>js/lib/elevatezoom/jquery.elevateZoom-3.js</script>
</action>

The error resolved and zoom is working.

like image 2
Julie Carlson Avatar answered Oct 16 '22 08:10

Julie Carlson


Open app/design/frontend/your-package/your-theme/template/catalog/product/view/media.html Comment below section of code

<!-- <script type="text/javascript">
    // <![CDATA[
        Event.observe(window, 'load', function() {
            product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
        });
    //]]>
    </script> -->
like image 1
Sushant Vishwas Avatar answered Oct 16 '22 07:10

Sushant Vishwas