4

I have added a product to the wishlist in following method (Magento Version 1.9.2.1)

1. Without login, click on "Add to wishlist" link in any product

2. Get redirected to Checkout login page

3. Enter user name password

4. Redirected to the particular user's Wishlist

Before installed the PATCH_SUPEE-9767, It worked. After Patched the product didn't added to wishlist.

1

I was provided a custom patch from Magento for this issue, that fixes it for EE 1.14. The only change that I think would be necessary is taking out the check for Enterprise_Pagecache, which I have done in the code below.

The solution is to add an event observer in a local module like the following:

// Model/Observer.php
...
public function replaceFormKeyForWishlistAdd(Varien_Event_Observer $observer)
{

    $formKey = Mage::getSingleton('core/session')->getFormKey();

    $session = Mage::getSingleton('customer/session');
    $beforeWishlistRequest = $session->getBeforeWishlistRequest();

    $beforeWishlistRequest['form_key'] = $formKey;
    $session->setBeforeWishlistRequest($beforeWishlistRequest);

    $newBeforeAuthUrl = Mage::getUrl('wishlist/index/add',
        array('product' => $beforeWishlistRequest['product'], 'form_key' => $formKey)
    );
    $session->setBeforeAuthUrl($newBeforeAuthUrl);
    return $this;
}
...

.

// etc/config.xml
...
<events>
    <customer_login>
        <observers>
            <namespace_module>
                <class>namespace_module/observer</class>
                <method>replaceFormKeyForWishlistAdd</method>
            </namespace_module>
        </observers>
    </customer_login>
</events>
...

Here is the patch, which makes these changes in the core: https://github.com/timciep/magento-tools/tree/master/Patches/SUPEE-10123_EE_1.14.0.1_v1.

  • Many thanks for your answer. Maybe there should have a condition for the existence of $beforeWishlistRequest otherwise some Notice "undefined index" will be raised when the user logged in without adding a product to wishlist. – Jiří Chmiel Mar 13 '18 at 11:19
0

PATCH_SUPEE-9767 is only about formkey in checkout. I think it will not disturb your wishlist. Some files of 9767 may override your customised files. Please re-check the patch files again

  • This PATCH I have done in Default Magento and tested. There are no Customized files I used. The PATCHES I have done as following order 6788, 7405, 7405 V 1.1, 9767 – Mohammed Aaqil Jun 23 '17 at 11:28
  • do you have backup of code and database before applying patch – Raghu Jun 23 '17 at 11:33
  • if you have backup, instead of applying patches please do upgrade to latest version from downloader. This will help you – Raghu Jun 23 '17 at 11:34
  • Did you install 8788 Patch? – Rama Chandran M Jun 23 '17 at 11:46
  • Yes, I have installed the 8788 Patch too. Still not working – Mohammed Aaqil Jun 23 '17 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.