@@ -51,7 +51,7 @@ final class AddProductToWishlistAction
5151 private $ urlGenerator ;
5252
5353 /** @var string */
54- private $ wishlistCookieId ;
54+ private $ wishlistCookieToken ;
5555
5656 public function __construct (
5757 ProductRepositoryInterface $ productRepository ,
@@ -61,14 +61,14 @@ public function __construct(
6161 FlashBagInterface $ flashBag ,
6262 TranslatorInterface $ translator ,
6363 UrlGeneratorInterface $ urlGenerator ,
64- string $ wishlistCookieId
64+ string $ wishlistCookieToken
6565 ) {
6666 $ this ->productRepository = $ productRepository ;
6767 $ this ->wishlistContext = $ wishlistContext ;
6868 $ this ->wishlistProductFactory = $ wishlistProductFactory ;
6969 $ this ->wishlistManager = $ wishlistManager ;
7070 $ this ->urlGenerator = $ urlGenerator ;
71- $ this ->wishlistCookieId = $ wishlistCookieId ;
71+ $ this ->wishlistCookieToken = $ wishlistCookieToken ;
7272 $ this ->flashBag = $ flashBag ;
7373 $ this ->translator = $ translator ;
7474 }
@@ -95,7 +95,7 @@ public function __invoke(Request $request): Response
9595 $ this ->wishlistManager ->flush ();
9696 $ this ->flashBag ->add ('success ' , $ this ->translator ->trans ('bitbag_sylius_wishlist_plugin.ui.added_wishlist_item ' ));
9797
98- $ cookie = new Cookie ($ this ->wishlistCookieId , $ wishlist ->getId (), strtotime ('+1 year ' ));
98+ $ cookie = new Cookie ($ this ->wishlistCookieToken , $ wishlist ->getToken (), strtotime ('+1 year ' ));
9999 $ response = new RedirectResponse ($ this ->urlGenerator ->generate ('bitbag_sylius_wishlist_plugin_shop_wishlist_list_products ' ));
100100 $ response ->headers ->setCookie ($ cookie );
101101
0 commit comments