Skip to content

Instantly share code, notes, and snippets.

@drewgillson
Created December 31, 2011 04:12
Show Gist options
  • Save drewgillson/1542838 to your computer and use it in GitHub Desktop.
Save drewgillson/1542838 to your computer and use it in GitHub Desktop.
Magento - applyCouponEvent
public function applyCouponEvent($observer){
$coupon_code = trim(Mage::getSingleton("checkout/session")->getData("coupon_code"));
if ($coupon_code != ''){
Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment