This is how my add to cart functionality works :
I have a quick link for each products on home page. When I click on the link, I get a popup by ajax with add to cart functionality.
On submit, it adds product to cart and redirects to the ajax url through which the popup was generated which is wrong. Basically the popup is on home page and I want it to redirect to home page.
Now the problem is that Checkout module takes referral url which is ajax url and redirects to it.
The Cart controller has all the functions as protected so I am not even able to use interceptors.
So basically I could not find a way to do this.