Overview:
On my product called Test Product has 10 quantity.
So when I put 40 quantity and press add to cart. (Remember, the quantity of the product is 10, so it should prompt an error)
The output is correct, the user got notified by the system that they put greater than the quantity than the actual quantity of the product.
If you look at the URL closely, before the user click the add to cart, the URL is
When the error has been shown, the URL is
Meaning, magento removes the category link and redirects to the actual product link.
Question Is there any way for magento to redirect to the current category instead of the product link?