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?

2 Answers 2

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

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

1
  • 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, 2014 at 12:53
0

I've found the following to work:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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