I want following actions to work on

  • Add to cart will add product in the cart only.

  • Buy Now will directly redirect the customer to the checkout page skipping cart step.

1 Answer 1


Rewrite you can do this magento two process

Process One:

one is rewrite the class Mage_Checkout_CartController and in this addAction() at code if (!$cart->getQuote()->getHasError()) { add redirection code $this->_redirect('checkout/onepage');

Process two:

Using event/Observer



This event provide the data of product object and cart request parameters

    array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())

Config.xml code:


Observer code:

using this event you can set your return url

$observer->getEvent()->getRequest()->setParam('return_url',Mage::getUrl('checkout/onepage')); this redirect to you at checkout Onepage function:

public function addToCartComplete(Varien_Event_Observer $observer) {
 $product = $observer->getEvent()->getProduct();

this redirect to you at Checkout onepage

  • Will this work with items with custom option and configurable?
    – KiD Cajes
    May 21, 2016 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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