Reputation: 61
I have seen answers that are close to what I am looking for. I want to add a product to the cart and also redirect to one page checkout in one single link tag from an email.
So far i have:
http://www.example.com/checkout/cart/add/product/20759/qty/1/
This successfully adds item to the cart, but does not re-direct to one page checkout. Is there any easy solution to add something to the url?
Ideally something like this?
http://www.example.com/checkout/cart/add/product/20759/qty/1/"one-page-checkout-link"
Thanks everyone!
Upvotes: 3
Views: 2060
Reputation: 31
Please use the form_key
for latest versions of magento.
Now the product will be add to cart in magento.
Note: Note the form_key
in url
You can get the form key by using the below code:
Mage::getSingleton('core/session')->getFormKey();
Upvotes: 1
Reputation: 61
Thanks David! You pointed me in the right direction. here is what did the trick:
If I had a higher rep I would vote you up.....
Thanks again.
Upvotes: 3
Reputation: 2072
If you add the parameter 'return_url' then this will work:
?return_url=http://magento.localhost/checkout/onepage/
It will need to be url encoded and also will be checked with the function _isUrlInternal
as you cannot redirect to external urls.
Upvotes: 5