Skip to content

Instantly share code, notes, and snippets.

@drewgillson
Created June 28, 2012 05:07
Show Gist options
  • Save drewgillson/3009230 to your computer and use it in GitHub Desktop.
Save drewgillson/3009230 to your computer and use it in GitHub Desktop.
Dg_Pricerulesextended GenerateController.php
class Dg_Pricerulesextended_GenerateController extends Mage_Core_Controller_Front_Action
{
public function promocodeAction() {
$helper = Mage::helper('pricerulesextended');
$params = $this->getRequest()->getParams();
$email = $params['email'];
$email = explode(',',$email);
$email = $email[0];
$promo_value = Mage::getStoreConfig('pricerulesextended/promocode/dollarvalue');
$promo_min = Mage::getStoreConfig('pricerulesextended/promocode/minpurchase');
$helper->addPromoCode($email, $promo_value, $promo_min);
$this->_redirectUrl('/');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment