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
$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.– SPRBRNMar 12, 2014 at 12:53
I've found the following to work:
$order_ov = get_object_vars($order);
$couponcode = $order_ov['_data']['coupon_code'];
-
1that is really odd the
$order->getCouponCode()
but if you have it working that is good news. May 26, 2014 at 8:29