Magento – add to cart and continue shopping url in single button

cartmagento-1.8url

I am using magento 1.8.
I am having custom add-to-cart button, that label is "Add to cart and continue shopping"

Magento have these both option seperatly, "Add-to-cart" and "continue Shopping"
How can I combine both the option in single button or click.
I mean when user clicks on "Add to cart and continue shopping" it need to add the product to cart and redirect to home page/product list page..

THANK YOU.

Best Answer

system->configuration->sales section ->checkout->shopping cart->After Adding a Product Redirect to Shopping Cart=no

mage->checkout->controllers->cartcontroller-> you need to work on addAction method (you can directly give $url=home url or product list url.and you need to override cartcontroller).

if (!$this->_getSession()->getNoCartRedirect(true)) {
                if (!$cart->getQuote()->getHasError()) {
                    $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
                    $this->_getSession()->addSuccess($message);
                }
                $this->_goBack();
            }

........... ....

$url = $this->_getSession()->getRedirectUrl(true);
            if ($url) {
                $this->getResponse()->setRedirect($url);
            } else {
                $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
            }