Skip to content

Commit

Permalink
Merge pull request #140 from BitBagCommerce/OPSRC-583/Import_wishlist…
Browse files Browse the repository at this point in the history
…_from_csv

remove exception if a product from the csv file doesn't exist
  • Loading branch information
PiotrSzymanski2000 authored Jul 1, 2022
2 parents d33d865 + 96ada78 commit 07b04e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/CommandHandler/Wishlist/ImportWishlistFromCsvHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ private function getDataFromFile(\SplFileInfo $fileInfo, Request $request): void

/** @var CsvWishlistProduct $csvWishlistProduct */
foreach ($csvWishlistProducts as $csvWishlistProduct) {
if (!$this->csvWishlistProductIsValid($csvWishlistProduct)) {
return;
if ($this->csvWishlistProductIsValid($csvWishlistProduct)) {
$variantIdRequestAttributes[] = $csvWishlistProduct->getVariantId();
$request->attributes->set('variantId', $variantIdRequestAttributes);
}
$variantIdRequestAttributes[] = $csvWishlistProduct->getVariantId();
}
$request->attributes->set('variantId', $variantIdRequestAttributes);
}

private function fileIsValidMimeType(\SplFileInfo $fileInfo): bool
Expand All @@ -96,7 +95,7 @@ private function csvWishlistProductIsValid(CsvWishlistProductInterface $csvWishl
]);

if (null === $wishlistProduct) {
throw new NotFoundHttpException();
return false;
}

return true;
Expand Down

0 comments on commit 07b04e9

Please sign in to comment.