Magento 2 Wishlist product add not working when user should in before login Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Add to wishlist without customer loginHow to add product to wishlist after login by guest customer?Magento call session object directly to get last added session messagesAdd to wishlist button not redirecting to login page while not logged inHow to create Guest Wishlist For MagentoProgrammatically add product to wishlist in Magento 2Product didn't added to wishlist after PATCH_SUPEE-9767 installed in version 1.9.2.1Working on ajax wishlist- click again to remove product from wishlistAdd To WishlistWishlist for guest in cart page not working shows “The requested cart item doesn't exist.'” in magento 2
What do you call the main part of a joke?
Can the Great Weapon Master feat's damage bonus and accuracy penalty apply to attacks from the Spiritual Weapon spell?
What are the diatonic extended chords of C major?
What is the meaning of 'breadth' in breadth first search?
Why is Nikon 1.4g better when Nikon 1.8g is sharper?
I am having problem understanding the behavior of below code in JavaScript
How come Sam didn't become Lord of Horn Hill?
Drawing without replacement: why is the order of draw irrelevant?
Is a ledger board required if the side of my house is wood?
Dating a Former Employee
What is this clumpy 20-30cm high yellow-flowered plant?
Is there a kind of relay that only consumes power when switching?
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Effects on objects due to a brief relocation of massive amounts of mass
Can a new player join a group only when a new campaign starts?
Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?
How would a mousetrap for use in space work?
How to compare two different files line by line in unix?
Most bit efficient text communication method?
Is it possible for SQL statements to execute concurrently within a single session in SQL Server?
Is it fair for a professor to grade us on the possession of past papers?
What is the difference between globalisation and imperialism?
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Project Euler #1 in C++
Magento 2 Wishlist product add not working when user should in before login
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Add to wishlist without customer loginHow to add product to wishlist after login by guest customer?Magento call session object directly to get last added session messagesAdd to wishlist button not redirecting to login page while not logged inHow to create Guest Wishlist For MagentoProgrammatically add product to wishlist in Magento 2Product didn't added to wishlist after PATCH_SUPEE-9767 installed in version 1.9.2.1Working on ajax wishlist- click again to remove product from wishlistAdd To WishlistWishlist for guest in cart page not working shows “The requested cart item doesn't exist.'” in magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am facing issue adding product in wishlist (magento version 2.2.3).
Here is scenario,
Step 1 :- Make sure customer not logged in.
Step 2 :- Go to product list page and click "Add to wishlist"
Step 3 :- it will redirected to login page.
Step 4 :- Now after login you can check product not added in wishlist.
magento2 wishlist
add a comment |
I am facing issue adding product in wishlist (magento version 2.2.3).
Here is scenario,
Step 1 :- Make sure customer not logged in.
Step 2 :- Go to product list page and click "Add to wishlist"
Step 3 :- it will redirected to login page.
Step 4 :- Now after login you can check product not added in wishlist.
magento2 wishlist
add a comment |
I am facing issue adding product in wishlist (magento version 2.2.3).
Here is scenario,
Step 1 :- Make sure customer not logged in.
Step 2 :- Go to product list page and click "Add to wishlist"
Step 3 :- it will redirected to login page.
Step 4 :- Now after login you can check product not added in wishlist.
magento2 wishlist
I am facing issue adding product in wishlist (magento version 2.2.3).
Here is scenario,
Step 1 :- Make sure customer not logged in.
Step 2 :- Go to product list page and click "Add to wishlist"
Step 3 :- it will redirected to login page.
Step 4 :- Now after login you can check product not added in wishlist.
magento2 wishlist
magento2 wishlist
asked 2 days ago
Bablu BarmanBablu Barman
214
214
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Generate new FormKey and replace for oldRequestParams Wishlist
vendormagentomodule-wishlistHelperData.php
just added below code in this file...
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataFormFormKey;
use MagentoFrameworkAppPageCacheFormKey as PageCacheFormKey;
use MagentoFrameworkSessionConfigConfigInterface;
use MagentoFrameworkStdlibCookieCookieMetadataFactory;
public function refreshFormKey()
$beforeWishlistRequest = $this->_customerSession->getBeforeWishlistRequest();
if ($beforeWishlistRequest !== null)
$formKeyData = ObjectManager::getInstance()->get(FormKey::class);
//form_key is already empty
$formKey = $formKeyData->getFormKey();
$sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
$cookieMetadata = ObjectManager::getInstance()->get(CookieMetadataFactory::class)->createPublicCookieMetadata();
$cookieMetadata->setDomain($sessionConfig->getCookieDomain());
$cookieMetadata->setPath($sessionConfig->getCookiePath());
$cookieMetadata->setDuration($sessionConfig->getCookieLifetime());
ObjectManager::getInstance()->get(PageCacheFormKey::class)->set(
$formKey,
$cookieMetadata
);
$beforeWishlistRequest['form_key'] = $formKey;
$this->_customerSession->setBeforeWishlistRequest($beforeWishlistRequest);
$this->_customerSession->setBeforeRequestParams($beforeWishlistRequest);
$this->_customerSession->setBeforeModuleName('wishlist');
$this->_customerSession->setBeforeControllerName('index');
$this->_customerSession->setBeforeAction('add');
return $this;
2. vendormagentomodule-wishlistObserverCustomerLogin.php
public function execute(Observer $observer)
$this->wishlistData->refreshFormKey(); // add this line only
$this->wishlistData->calculate();
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270336%2fmagento-2-wishlist-product-add-not-working-when-user-should-in-before-login%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Generate new FormKey and replace for oldRequestParams Wishlist
vendormagentomodule-wishlistHelperData.php
just added below code in this file...
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataFormFormKey;
use MagentoFrameworkAppPageCacheFormKey as PageCacheFormKey;
use MagentoFrameworkSessionConfigConfigInterface;
use MagentoFrameworkStdlibCookieCookieMetadataFactory;
public function refreshFormKey()
$beforeWishlistRequest = $this->_customerSession->getBeforeWishlistRequest();
if ($beforeWishlistRequest !== null)
$formKeyData = ObjectManager::getInstance()->get(FormKey::class);
//form_key is already empty
$formKey = $formKeyData->getFormKey();
$sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
$cookieMetadata = ObjectManager::getInstance()->get(CookieMetadataFactory::class)->createPublicCookieMetadata();
$cookieMetadata->setDomain($sessionConfig->getCookieDomain());
$cookieMetadata->setPath($sessionConfig->getCookiePath());
$cookieMetadata->setDuration($sessionConfig->getCookieLifetime());
ObjectManager::getInstance()->get(PageCacheFormKey::class)->set(
$formKey,
$cookieMetadata
);
$beforeWishlistRequest['form_key'] = $formKey;
$this->_customerSession->setBeforeWishlistRequest($beforeWishlistRequest);
$this->_customerSession->setBeforeRequestParams($beforeWishlistRequest);
$this->_customerSession->setBeforeModuleName('wishlist');
$this->_customerSession->setBeforeControllerName('index');
$this->_customerSession->setBeforeAction('add');
return $this;
2. vendormagentomodule-wishlistObserverCustomerLogin.php
public function execute(Observer $observer)
$this->wishlistData->refreshFormKey(); // add this line only
$this->wishlistData->calculate();
add a comment |
Generate new FormKey and replace for oldRequestParams Wishlist
vendormagentomodule-wishlistHelperData.php
just added below code in this file...
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataFormFormKey;
use MagentoFrameworkAppPageCacheFormKey as PageCacheFormKey;
use MagentoFrameworkSessionConfigConfigInterface;
use MagentoFrameworkStdlibCookieCookieMetadataFactory;
public function refreshFormKey()
$beforeWishlistRequest = $this->_customerSession->getBeforeWishlistRequest();
if ($beforeWishlistRequest !== null)
$formKeyData = ObjectManager::getInstance()->get(FormKey::class);
//form_key is already empty
$formKey = $formKeyData->getFormKey();
$sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
$cookieMetadata = ObjectManager::getInstance()->get(CookieMetadataFactory::class)->createPublicCookieMetadata();
$cookieMetadata->setDomain($sessionConfig->getCookieDomain());
$cookieMetadata->setPath($sessionConfig->getCookiePath());
$cookieMetadata->setDuration($sessionConfig->getCookieLifetime());
ObjectManager::getInstance()->get(PageCacheFormKey::class)->set(
$formKey,
$cookieMetadata
);
$beforeWishlistRequest['form_key'] = $formKey;
$this->_customerSession->setBeforeWishlistRequest($beforeWishlistRequest);
$this->_customerSession->setBeforeRequestParams($beforeWishlistRequest);
$this->_customerSession->setBeforeModuleName('wishlist');
$this->_customerSession->setBeforeControllerName('index');
$this->_customerSession->setBeforeAction('add');
return $this;
2. vendormagentomodule-wishlistObserverCustomerLogin.php
public function execute(Observer $observer)
$this->wishlistData->refreshFormKey(); // add this line only
$this->wishlistData->calculate();
add a comment |
Generate new FormKey and replace for oldRequestParams Wishlist
vendormagentomodule-wishlistHelperData.php
just added below code in this file...
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataFormFormKey;
use MagentoFrameworkAppPageCacheFormKey as PageCacheFormKey;
use MagentoFrameworkSessionConfigConfigInterface;
use MagentoFrameworkStdlibCookieCookieMetadataFactory;
public function refreshFormKey()
$beforeWishlistRequest = $this->_customerSession->getBeforeWishlistRequest();
if ($beforeWishlistRequest !== null)
$formKeyData = ObjectManager::getInstance()->get(FormKey::class);
//form_key is already empty
$formKey = $formKeyData->getFormKey();
$sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
$cookieMetadata = ObjectManager::getInstance()->get(CookieMetadataFactory::class)->createPublicCookieMetadata();
$cookieMetadata->setDomain($sessionConfig->getCookieDomain());
$cookieMetadata->setPath($sessionConfig->getCookiePath());
$cookieMetadata->setDuration($sessionConfig->getCookieLifetime());
ObjectManager::getInstance()->get(PageCacheFormKey::class)->set(
$formKey,
$cookieMetadata
);
$beforeWishlistRequest['form_key'] = $formKey;
$this->_customerSession->setBeforeWishlistRequest($beforeWishlistRequest);
$this->_customerSession->setBeforeRequestParams($beforeWishlistRequest);
$this->_customerSession->setBeforeModuleName('wishlist');
$this->_customerSession->setBeforeControllerName('index');
$this->_customerSession->setBeforeAction('add');
return $this;
2. vendormagentomodule-wishlistObserverCustomerLogin.php
public function execute(Observer $observer)
$this->wishlistData->refreshFormKey(); // add this line only
$this->wishlistData->calculate();
Generate new FormKey and replace for oldRequestParams Wishlist
vendormagentomodule-wishlistHelperData.php
just added below code in this file...
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkDataFormFormKey;
use MagentoFrameworkAppPageCacheFormKey as PageCacheFormKey;
use MagentoFrameworkSessionConfigConfigInterface;
use MagentoFrameworkStdlibCookieCookieMetadataFactory;
public function refreshFormKey()
$beforeWishlistRequest = $this->_customerSession->getBeforeWishlistRequest();
if ($beforeWishlistRequest !== null)
$formKeyData = ObjectManager::getInstance()->get(FormKey::class);
//form_key is already empty
$formKey = $formKeyData->getFormKey();
$sessionConfig = ObjectManager::getInstance()->get(ConfigInterface::class);
$cookieMetadata = ObjectManager::getInstance()->get(CookieMetadataFactory::class)->createPublicCookieMetadata();
$cookieMetadata->setDomain($sessionConfig->getCookieDomain());
$cookieMetadata->setPath($sessionConfig->getCookiePath());
$cookieMetadata->setDuration($sessionConfig->getCookieLifetime());
ObjectManager::getInstance()->get(PageCacheFormKey::class)->set(
$formKey,
$cookieMetadata
);
$beforeWishlistRequest['form_key'] = $formKey;
$this->_customerSession->setBeforeWishlistRequest($beforeWishlistRequest);
$this->_customerSession->setBeforeRequestParams($beforeWishlistRequest);
$this->_customerSession->setBeforeModuleName('wishlist');
$this->_customerSession->setBeforeControllerName('index');
$this->_customerSession->setBeforeAction('add');
return $this;
2. vendormagentomodule-wishlistObserverCustomerLogin.php
public function execute(Observer $observer)
$this->wishlistData->refreshFormKey(); // add this line only
$this->wishlistData->calculate();
edited 2 days ago
answered 2 days ago
Bablu BarmanBablu Barman
214
214
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270336%2fmagento-2-wishlist-product-add-not-working-when-user-should-in-before-login%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown