Reputation: 3203
I'm trying to send a user to checkout programmatically in Magento. I can send them to $this->_redirect('checkout/onepage');
but if they have some sort of third party checkout extension I won't be using the proper one. Is there a way to get the default checkout url for the site and redirect there?
Upvotes: 4
Views: 24936
Reputation: 399
you can try with
$checkout_link = Mage::helper('checkout/url')->getCheckoutUrl();
this return checkout link in all conditions
Upvotes: 20
Reputation: 9100
By default checkout link is returned by getCheckoutUrl()
function of Mage_Checkout_Block_Onepage_Link
class. If is quite simple:
public function getCheckoutUrl()
{
return $this->getUrl('checkout/onepage', array('_secure'=>true));
}
3rd party extensions will most likely override this class (i checked OneStepCheckout 1.4 and it works like this).
Upvotes: 4