diff --git a/core/modules/catalog/helpers/index.ts b/core/modules/catalog/helpers/index.ts index f7be496fcf..3d90010dcf 100644 --- a/core/modules/catalog/helpers/index.ts +++ b/core/modules/catalog/helpers/index.ts @@ -474,12 +474,6 @@ export function configureProductAsync (context, { product, configuration, select desiredProductFound = true } - if (typeof navigator !== 'undefined') { - if (selectedVariant && !navigator.onLine && context.state.offlineImage) { // this is fix for not preloaded images for offline - selectedVariant.image = context.state.offlineImage - Logger.debug('Image offline fallback to ', context.state.offlineImage)() - } - } if (selectedVariant) { if (!desiredProductFound) { // update the configuration populateProductConfigurationAsync(context, { product: product, selectedVariant: selectedVariant }) @@ -537,6 +531,7 @@ export function getMediaGallery (product) { mediaGallery.push({ 'src': getThumbnailPath(mediaItem.image, rootStore.state.config.products.gallery.width, rootStore.state.config.products.gallery.height), 'loading': getThumbnailPath(mediaItem.image, 310, 300), + 'error': getThumbnailPath(mediaItem.image, 310, 300), 'video': mediaItem.vid }) } @@ -562,6 +557,7 @@ export function configurableChildrenImages(product) { configurableChildrenImages.push({ 'src': getThumbnailPath(groupedByAttribute[confChild][0].image, rootStore.state.config.products.gallery.width, rootStore.state.config.products.gallery.height), 'loading': getThumbnailPath(groupedByAttribute[confChild][0].image, 310, 300), + 'error': getThumbnailPath(groupedByAttribute[confChild][0].image, 310, 300), 'id': confChild }) } @@ -583,7 +579,8 @@ export function attributeImages(product) { if(product[attribute]) { attributeImages.push({ 'src': getThumbnailPath(product[attribute], rootStore.state.config.products.gallery.width, rootStore.state.config.products.gallery.height), - 'loading': getThumbnailPath(product[attribute], 310, 300) + 'loading': getThumbnailPath(product[attribute], 310, 300), + 'error': getThumbnailPath(product[attribute], 310, 300) }) } } diff --git a/core/modules/catalog/store/product/actions.ts b/core/modules/catalog/store/product/actions.ts index e9cf907a2b..936b2a1f3d 100644 --- a/core/modules/catalog/store/product/actions.ts +++ b/core/modules/catalog/store/product/actions.ts @@ -578,10 +578,6 @@ const actions: ActionTree = { // get original product const productOriginal = context.getters.productOriginal - if (!context.state.offlineImage) { - context.state.offlineImage = productThumbnailPath(productOriginal ? productOriginal /** in case if it's not yet set */ : productVariant, true) - Logger.debug('Image offline fallback set to ' + context.state.offlineImage, 'product')() - } // check if passed variant is the same as original const productUpdated = Object.assign({}, productOriginal, productVariant) populateProductConfigurationAsync(context, { product: productUpdated, selectedVariant: productVariant }) diff --git a/src/themes/default/components/core/ProductGallery.vue b/src/themes/default/components/core/ProductGallery.vue index 3b0ecb4285..fef0aa01d1 100644 --- a/src/themes/default/components/core/ProductGallery.vue +++ b/src/themes/default/components/core/ProductGallery.vue @@ -1,6 +1,6 @@