I am a newbie, after extensive research and exploration I am able to figure out the following:
To add a product to cart I can use
/checkout/cart/add?product=76&qty=1
to apply discount code I can use
/checkout/cart/couponPost?coupon_code=WQ9D-XXXX
The code for it resides in file:
/public_html/app/code/local/Mage/Checkout/controllers/-
I would like to add product and apply discount code in one link such as:
/checkout/cart/couponPost?product=76&qty=1&coupon_code=WQ9D-XXXX
OR
/checkout/cart/add?product=76&qty=1&coupon_code=WQ9D-XXXX
OR Any other means?
Is there a way to get this working? Idea is to embed this link in a newsletter so using one click the user is able to add the product to cart and get discount.
I have tried calling $this->couponPostAction();
from function addAction()
and vice-versa but it does not work!
Got it working without modifying the code,
'http://www.example.com/checkout/cart/add?Product=76&qty;=1&return;_url=http://www.example.com/index.php/checkout/cart/couponPost?coupon_code=WQ9D-XXXX&return;_url=http://www.example.com/checkout/cart/'
the return_url has to be encoded.
Please see: http://www.magentocommerce.com/boards/viewthread/296763/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With