Replies: 10 comments
-
| 
         I checked the part of the code which is responsible for the error: /app/code/core/Mage/Wishlist/controllers/IndexController.php Look at that if statement. Running the code these two variables have the following values: $this->_isFormKeyEnabled() = bool(true) Based on these values the evaluation is always true. Magento is doing the job just of part of it creating a new logged session but instead of accessing the customer account and adding the product to the wishlist it is coming back to the page from where the request came. I will do more tests by changing in one template AddToWishListUrlCustom to AddToWishListUrl for backward compatibility. If it is not working again I will replace the core file with one from a previous version to see what is happening.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         In Magento Team did a change in the Index controller in 1.9.4.3. Making a diff between OpenMage 20.0.6 and Magento 1.9.4.2 the if statement from above was introduced. By commenting the lines 144 - 149 in /app/code/core/Mage/Wishlist/controllers/IndexController.php I was able to use this feature as usual without any error. All templates remained the same as before with the modifications introduced in 1.9.4.3. Here is an example from a template: Let's evaluate a little the code from the controller. There is no doubt $this->_isFormKeyEnabled() value is always true. If I navigate as I guest by pressing [Add to Wishlist] button I will be redirected to login page (/customer/account/login/) . The URL contains "login" string and strpos function will return a positive value. In this way the if evaluation will always be true. The guest will login but will have to add again the product which is annoying and a bug into the code. I did a modification by changing login string to login1. I was able to login into my account and see the item added to the wishlist. No errors and this is the same like commenting the if statement. If anyone has some time please evaluate what is the impact of commenting the code. At least with this modification we will solve the issue. To solve this issue I see the following scenarios: 
 Any insides are welcomed.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         @addison74 I'd remove "bug confirmed" and close. It looks like it is wanted - to refresh the formkey. I dont think its neccessaary to change to message.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         If a Guest visitor wants to add a product to the wishlist, he should be informed about the whole procedure through a message. First, he would be told that he will be redirected to the login page, and after creating/accessing the account to add the product. If you don't want the redirecting, a message can be displayed that you must log into the account to be able to add products to the wishlisht, I think this would be much better. As a personal opinion, the message displayed after logging in is very confusing "Please add product to wishlist again". I just added the product then I logged in and why do I need to add it again? I mean, should I go back and repeat the same steps, but in what page I added it? Maybe a link to go back to the page from where I started it should be the solution, like Magento Team did after adding a product in the wishlist, the displayed message is "Product ABC has been added to your wishlist. Click [here] to continue shopping." Also the message "Please add product to wishlist again" must be change to "Please add the product to the wishlisht again", accompanied by an explanation.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Move to discussions?  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I would not move it to the Discussions section. Let's analyze the feature to add products to the Wish List for Guest visitors. 
 Step 5 is really annoying, based on an unprofessional approach. I should search for the product or use the browser history. How do we solve this issue? Solution 1: When I click the "Add to Wishlist" link, I should see a warning message on the same page like this "Please log into your customer account to add products to the Wish List. If you don't have one please create it.". In this message I will include also the link to /customer/account. In my opinion redirection in a few seconds is not an option. Solution 2: When I click the "Add to Wishlist" link, I am redirected to the Customer Account page (create / login page). I create/login into my customer account then I should be redirected to the page where the whole process started. A warning message should inform me to add the product to the wish list. To solve the problem with the random product, I should keep the added product "somewhere" (session, ...) then redirect to its page after logging into the account.  | 
  
Beta Was this translation helpful? Give feedback.
-
        
 Can you retry? This happens for me. After login i get redirected to the page where i wanted to add the product to wishlist.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         @sreichel - I am using a fresh install, OpenMage v20 the latest with the Magento Sample Data pack. The environment is as usual based on DDEV and PHP 8.4. In order to see this bug in action clear your browser cache or disable it (better). Visit this category first https://openmage.ddev.site/women/tops-blouses.html then add "Elizabeth Knit Top" to the wish list. Next you will get this page https://openmage.ddev.site/customer/account/login/, use your credentials. You will be redirected to the category seeing the error message "Please add product to the wishlist again". Except the message which is not explanatory and the missing "the" in the phrase, all is good. Let's go further. Category Page Product Page Please note I did not check what is happening for other places in the Frontend, like CMS pages (Home), Cart page, Blocks in pages where Add to Wishlist is available. Personal comments 
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks. Will check it later.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Over the last days I've thoroughly investigated the possibility of showing a Magento-style warning/notice message on the product page when a guest user tries to add a product to the wishlist (instead of redirecting instantly to the login page). What I tried: 
 Findings: 
 Conclusion: If anyone finds a better/cleaner approach, please share!  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
OpenMage v20.0.6
To reproduce this annoying issue you should have created before: a category, a product associated to the category, a customer account.
Do not login into the account!
In frontend visit as guest the created category and press [Add to Wishlist]. You will be redirected as usual to path /customer/account/login/. Fill up the email and password and press [Login].
Instead of getting into the customer account and see the confirmation that the product was added to wishlist you will get the category page with the following error message: "Please add product to wishlist again". See the image bellow:
Please note you are logged in already. By pressing again [Add to Wishlist] the product will be added to wishlist and you are now visiting the customer page which is the correct behavior. See the image bellow:
I did not check this issue with other versions of Magento but I suppose it is coming from the changes the team made when added form keys for Add Wishlist. I will make time to install a fresh Magento 1.9.4.3 which has no form keys form Add to Cart, Add to Wishlist and Add to Compare and see if I confirm it again.
As it is now this issue creates confusion and becomes really annoying for a visitor.
Beta Was this translation helpful? Give feedback.
All reactions