As we know that
Form key feature has been added to new versions of Magento. This affects old themes or modules for adding product to cart, wishlist and placing an order. I faced a situation where a third party module for Brands, users were not able to add the products to cart nor to wishlist. On troubleshooting, I found that, the form key used by the brands module was different than of the normal product listing pages and I also found that the form key used for one category page remains the same for other category pages as well, so its seems it doesn't update for a particular session i guess and our module should has to follow the same.
however, I wrote a piece of code to update form key, in the add to cart url, with valid one using events and hence products were successfully added to cart and wishlist.
My question is:
Is there a general way developed/allowed by the Magento team, so that such third party modules, which are developed to list the products on some basis, are simply forced to follow the valid form key which is used by the default product listings instead of generating a new one?
Edit: The key returned by
Mage::getSingleton('core/session')->getFormKey(); for custom product listing is not valid for adding the product to wishlist or cart.