This component is located in Magento_Catalog/js/product-gallery

map: {
    '*': {
        categoryForm:       'Magento_Catalog/catalog/category/form',
        newCategoryDialog:  'Magento_Catalog/js/new-category-dialog',
        categoryTree:       'Magento_Catalog/js/category-tree',
        productGallery:     'Magento_Catalog/js/product-gallery',
        baseImage:          'Magento_Catalog/catalog/base-image-uploader',
        productAttributes:  'Magento_Catalog/catalog/product-attributes'

I already copied the same file with a different name but when my component runs, it does not work properly like the original one. Official docs mentions to extend it, but i can't make it work successfully
It would be more helpful if the core teams explain more details for me as to how to implement it

1 Answer 1


1 . Initialize js components

var config = {
   "map": {
        '*': {
           "productGallery2": 'Vendor_CustomModule/js/product-gallery'
   "shim": {
       "ves/productGallery2": ["productGallery","baseImage"]
   "deps": [
   "paths": {
       "your_namespace/productGallery2": "Vendor_CustomModule/js/product-gallery"

2. Extend widget

 ], function (jQuery, mageTemplate, alert) {
"use strict";

jQuery.widget('yourNamespace.productGallery', {
    options: {
        //init vars

    //override original method
    original: function() {
        //modify code

    return jQuery.yourNamespace.productGallery;

Clear var/cache, var/generation, pub/static/adminhtml , pub/static/_requirejs for update I got new issues . But better should post it in another question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.