0

Can anyone please help me to display the description part from shopping cart price rule when customer apply the coupon on Magento 1.9.

This Magento get coupon description is not working form my version.

Community
  • 1
  • 1
4519398
  • 1
  • 7
  • 1
    Can we see the code that you do have? A couple of sentences doesn't usually make a good, detailed question here. If you can expand on "not working" that is helpful too. – halfer Feb 02 '15 at 10:40
  • I mean the code from tht link is not responding in magento 9.1.. Code which i used is $rule = Mage::getModel('salesrule/rule')->load($code, 'coupon_code'); if ($rule->getId()) { $description = $rule->getDescription(); } – 4519398 Feb 02 '15 at 14:37
  • ^ In the question, please - would you edit your question? There are code formatting tools too. – halfer Feb 02 '15 at 14:39

2 Answers2

0

Try this code :

$coupon = Mage::getModel('salesrule/coupon');
$coupon->load($this->getQuote()->getCouponCode(), 'code');
$couponObj = Mage::getModel('salesrule/rule')->load($coupon->getRuleId());
echo $couponObj->getDescription();
Suresh Chikani
  • 948
  • 2
  • 9
  • 23
  • Errod came:Call to undefined method Mage_Checkout_CartController::getQuote() in D:\wamp\www\Jamuna\site1\app\code\core\Mage\Checkout\controllers\CartController.php on line 580 – 4519398 Feb 02 '15 at 14:35
0

load($this->getQuote()->getCouponCode(), 'code');$couponObj = Mage::getModel('salesrule/rule')->load($coupon->getRuleId()); ?>getName();?>getDescription();?>