Skip to content

Commit

Permalink
Merge pull request #1293 from mailchimp/Issue1288-2.4
Browse files Browse the repository at this point in the history
closes #1288 for magento 2.4
  • Loading branch information
gonzaloebiz authored Sep 7, 2021
2 parents 93f8716 + a192b3f commit e23e1e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Model/Api/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ protected function _buildProductData(
$data["url"] = $product->getProductUrl();
$data["image_url"] = '';
if ($product->getImage() && $product->getImage()!='no_selection') {
$filePath = 'catalog/product'.$product->getImage();
$filePath = 'catalog/product/'.ltrim($product->getImage(), '/');
$data["image_url"] = $this->_helper->getBaserUrl(
$magentoStoreId,
\Magento\Framework\UrlInterface::URL_TYPE_MEDIA
Expand All @@ -403,7 +403,7 @@ protected function _buildProductData(
} else {
$parent = $this->_getParent($product->getId(), $magentoStoreId);
if ($parent && $parent->getImage() && $parent->getImage()!='no_selection') {
$filePath = 'catalog/product'.$parent->getImage();
$filePath = 'catalog/product/'.ltrim($parent->getImage(), '/');
$data["image_url"] = $this->_helper->getBaserUrl(
$magentoStoreId,
\Magento\Framework\UrlInterface::URL_TYPE_MEDIA
Expand Down

0 comments on commit e23e1e9

Please sign in to comment.