Skip to content

Instantly share code, notes, and snippets.

@jpujari
jpujari / keybase.md
Last active September 13, 2019 17:15

Keybase proof

I hereby claim:

  • I am jpujari on github.
  • I am cryptojeetu (https://keybase.io/cryptojeetu) on keybase.
  • I have a public key ASCOa_ghX3QZVB-bciNAU_W2vHGNkfYYrCZ35dR9pfYxnwo

To claim this, I am signing this object:

@jpujari
jpujari / applyCouponCodeAction.php
Last active December 10, 2015 20:19 — forked from drewgillson/applyCouponCodeAction.php
Magento - apply coupon code automatically
public function indexAction() {
$coupon_code = $this->getRequest()->getParam('coupon_code');
if ($coupon_code != '') {
Mage::getSingleton("checkout/session")->setData("coupon_code",$coupon_code);
Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();
Mage::getSingleton('core/session')->addSuccess($this->__('Coupon was automatically applied'));
}
else {
Mage::getSingleton("checkout/session")->setData("coupon_code","");