I am trying to create extension that add coupon code (Ajax) to one page checkout page last step. See http://www.lelandcope.com/2012/04/how-to-create-an-ajax-coupon-discount-code-box-in-magento/
Following code of CartController
customcouponPostAction()
which applies coupon code. its works fine
$this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
$this->_getQuote()->getShippingAddress()->collectShippingRates();
$this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
->collectTotals()
->save();
Shipping and handling charges
calculation work fine as per table rate
but when another Shopping Cart Price Rule
which is free shipping above $15
(See http://www.phpro.be/news/configuring-shopping-cart-price-rules-magento-free-shipping) is also valid then shipping charge not become zero its still same as table rate.
Same scenario works like charm in cart page.
What am I missing?
$this->_getQuote()->getShippingAddress()->collectShippingRates();
from above code the ajax response didn't reflect correctShipping and handling charges
even as per table rate. but if refresh page its show correctShipping and handling charges
.