configurable.js:294 Uncaught TypeError: $(...).AddFotoramaVideoEvents is not a functionI have narrowed it down to this line $(this.options.mediaGallerySelector).AddFotoramaVideoEvents(); if you comment this out the error will obviously go away. I am just confused why it is trying to create a FotoramaVideoEvents widget when it is just an image.
@Yamaha32088 Hi, unfortunally, I can't reproduce the issue as you described it. May you please confirm if this problem is relevant on latest release version of Magento 2?
According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.
I can confirm that issue for Magento 2.1.7.
EDIT: This problem does only appear when deactiving Magento_ProductVideo
This problem is caused when module-product-video is disabled because module-swatches has a dependency to module-product-video in swatch-renderer.js.
Even if the Magento ProductVideo module is enabled but the gallery.phtml block that it adds is moved or removed, you will get this error.
Kind of a silly dependency, I feel like this call to AddFotoramaVideoEvents() should be added to the swatch-renderer.js file via a mixin.
Anyway, my fix was to override the swatch-renderer.js file (copy it to Magento_Swatches/web/js/ in my theme) and just add a wrapper to test if the method exists:
if (isInitial) {
if ($.isFunction($(this.options.mediaGallerySelector).AddFotoramaVideoEvents)) {
$(this.options.mediaGallerySelector).AddFotoramaVideoEvents();
}
}
When overriding the catalog_product_view.xml, it seems that the changes in ProductVideo are no longer applied – so the line has to be added manually:
It works for me
<container name="product.info.media" htmlTag="div" htmlClass="product media" after="product.info.main">
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" as="media_image" template="product/view/gallery.phtml"/>
<block class="Magento\ProductVideo\Block\Product\View\Gallery" name="product.info.media.video" after="product.info.media.image" template="product/view/gallery.phtml"/>
</container>