Sometimes it is nice to be able to take user directly to the shopping cart with product and discount coupon applied. e.g. from a email newsletter. There a few extensions out there that does this, they seem unnecessary. Magento out of box provide following:
To add Product:
where 76 is product id and 1 is the quantity.
To apply coupon code:
where WQ9D-XXXX is the coupon code.
additional magento also provides parameter for return URL
Bringing it all together in one URL:
The first return URL has to be encoded. Use your fav encoder
It works in 1.7.