Skip to content

Commit

Permalink
Merge pull request #10 from EmicoEcommerce/feature/image-position
Browse files Browse the repository at this point in the history
Put base image first in media gallery.
  • Loading branch information
Hnto authored Feb 23, 2021
2 parents 50b4aab + 6f58a2e commit e9cd37e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Queue/Action/Asset/Strategy/ProductImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ public function execute(
->setContent($content)
->setFile($tmpPath)
->setMediaType('image')
->setDisabled(false)
->setTypes($metadataExtractor->getAssetTypes());
->setDisabled(false);

$mediaTypes = $metadataExtractor->getAssetTypes();
$entry->setTypes($mediaTypes);
if (in_array('image', $mediaTypes)) {
$entry->setPosition(0);
}

$oldImgId = $this->resolveOldImageId($product);
if (null === $oldImgId) {
Expand Down

0 comments on commit e9cd37e

Please sign in to comment.