Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 20846: Use helper to get scoped base media URL
## What's being changed Fetching a product image URL for catalog sync, in `UrlFinder`. ## Why it's being changed The current `getMediaUrl()` method to fetch a media URL for the small image only gets the URL set at default level. This is a problem for some merchants who set the default value to e.g. 'admin.site.com' and then have a firewall on that subdomain. The `getSmallImageUrl()` helper method now in place is able to get the frontend URL for the supplied product, which is what we need for catalog insight data. ## How to review / test this change - Set the Base Media URL for your Main Website to be different from the URL set at default - Set catalog sync to run at Store level - Run catalog sync - Confirm that the 'imagePath' fields use the desired base media URL, and that the complete paths output are correct. - Check that if catalog sync runs at default level, the default base media URL is used ## Notes - In our testing we've noticed that the modified call outputs an image path with two slashes in it e.g. http://stuff.m19develop.local/media/catalog/product//m/s/msj000t_2.jpg. This appears to be core Magento behaviour and doesn't affect the resolution of the URL. - Magento will use the base media URL of the first website to which the product belongs. e.g. if product X belongs to websites 2 and 3, the image path will use the base media URL of website 2. Related work items: #113530
- Loading branch information