File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -173,16 +173,9 @@ public function getImageInfo($image)
173
173
public function getImageUrl ($ image )
174
174
{
175
175
if (is_object ($ image )) $ image = $ image ->getImage ();
176
+ $ image = substr ($ image , strpos ($ image , "media/ " ) + strlen ('media/ ' ));
176
177
if ($ image ) {
177
- if (substr ($ image , 0 , 1 ) === '/ ' ) {
178
- $ url = $ this ->storeManager ->getStore ()->getBaseUrl (
179
- \Magento \Framework \UrlInterface::URL_TYPE_WEB
180
- ) . ltrim ($ image , '/ ' );
181
- } else {
182
- $ url = $ this ->storeManager ->getStore ()->getBaseUrl (
183
- \Magento \Framework \UrlInterface::URL_TYPE_MEDIA
184
- ) . 'catalog/category/ ' . $ image ;
185
- }
178
+ $ url = $ this ->storeManager ->getStore ()->getBaseUrl ( \Magento \Framework \UrlInterface::URL_TYPE_MEDIA ) . $ image ;
186
179
} else {
187
180
$ url = $ this ->viewAssetRepo ->getUrl ('Magento_Catalog::images/product/placeholder/small_image.jpg ' );
188
181
}
You can’t perform that action at this time.
0 commit comments