0

I would like to use shopping cart rule information in the invoice PDF. For certain rules I want to add some information in the PDF. How can I get these values?

1
$couponCode= Mage::getModel('sales/order')->loadByIncrementId(ORDERID)->getCouponCode();

You can then look up the cart rule info, using salesrule/rule model.

  • Maybe I'm doing something wrong, but it doesn't work. I've found the following to work: $order_ov = get_object_vars($order); $couponcode = $order_ov['_data']['coupon_code']; don't know if this is 'bad coding' or not, but it works. – SPRBRN Mar 12 '14 at 12:53
0

I've found the following to work:

$order_ov = get_object_vars($order); 
$couponcode = $order_ov['_data']['coupon_code'];
  • 1
    that is really odd the $order->getCouponCode() but if you have it working that is good news. – David Manners May 26 '14 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.