Skip to content

Commit

Permalink
Merge pull request #218 from BitBagCommerce/fix-message-wishlist-has-…
Browse files Browse the repository at this point in the history
…product

Fix message wishlist has product
  • Loading branch information
senghe authored Aug 9, 2023
2 parents 8bff941 + 8539bbc commit bcbe29e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Controller/Action/AddProductVariantToWishlistAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ private function addProductToWishlist(
$flashBag = $session->getFlashBag();

if ($wishlist->hasProductVariant($variant)) {
$message = sprintf('%s variant is already in wishlist.', $wishlistProduct->getProduct()->getName());
$flashBag->add('error', $this->translator->trans($message));
$flashBag->add(
'error',
$this->translator->trans(
'bitbag_sylius_wishlist_plugin.ui.wishlist_has_product_variant',
['%productName%' => $wishlistProduct->getProduct()->getName()]
)
);

return;
}
Expand Down
1 change: 1 addition & 0 deletions src/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ bitbag_sylius_wishlist_plugin:
wishlist_save: Save wishlist
wishlist_saved: Wishlist has been saved.
you_have_no_access_to_that_wishlist: You have no access to that wishlist.
wishlist_has_product_variant: '%productName% variant is already in wishlist.'

0 comments on commit bcbe29e

Please sign in to comment.