Skip to content

Commit

Permalink
Fix jade
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 committed Nov 18, 2024
1 parent 9a4598f commit e8e42c1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions resources/js/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ function init() {
}
},
resizedPath(imagePath, size, store = config.store) {
let url = new URL(imagePath)
url = url.pathname.replace('/media', '')
let mediaPosition = imagePath.indexOf('/media/')
if (mediaPosition > 0) {
return `/storage/${store}/resizes/${size}/magento` + imagePath.substr(mediaPosition + 6)
}

let productPosition = imagePath.indexOf('/product/')
if (productPosition > 0) {
return `/storage/${store}/resizes/${size}/magento/catalog` + imagePath.substr(productPosition)
}

return `/storage/${store}/resizes/${size}/magento${url}`
return `/storage/${store}/resizes/${size}/magento/catalog/product` + imagePath
},
},
computed: {
Expand Down

0 comments on commit e8e42c1

Please sign in to comment.