Skip to content

Commit

Permalink
Merge pull request #10 from alpin11/fix/remove-images
Browse files Browse the repository at this point in the history
remove images because of performance
dlhck authored Sep 21, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 91c7b02 + 02bce27 commit fc2ac7a
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/Extension/ConvertOrderItemsExtension.php
Original file line number Diff line number Diff line change
@@ -210,28 +210,6 @@ protected function transformOrderItemToLineItem(OrderItemInterface $orderItem, $
if ($product instanceof ProductInterface) {
$lineItem['sku'] = $product->getSku();

$image = $product->getImage();

if ($image instanceof Asset\Image) {
$imageUrl = $image->getThumbnail([
'width' => 150,
'aspectratio' => true,
'format' => 'png',
'quality' => 80
])->getPath();

// if not valid url we only have the path to the thumbnail
// so we need to prepend the host url
if (!filter_var($imageUrl, FILTER_VALIDATE_URL)) {
$imageUrl = Tool::getHostUrl() . $imageUrl;
}

// only set imageUrl if its valid
if (filter_var($imageUrl, FILTER_VALIDATE_URL)) {
$lineItem['imageUrl'] = $imageUrl;
};
}

$lineItem['productUrl'] = Tool::getHostUrl() . $this->linkGeneratorHelper->getPath($product, null, [
'_locale' => $locale
]);

0 comments on commit fc2ac7a

Please sign in to comment.