How do i find the variable name for coupon code and coupon value?

Can anyone tell me how I can include the coupon code and value of the coupon in an Order CSV that gets sent to the order fulfillment company? I am using Magento CE 1.8.1.

Basically when an order is generated, it also generates a CSV file with the order details and uploads this to the order fulfillment company. Looking through the code I can see that it pulls in other order data from variables e.g:

    $billingAddress = $order->getBillingAddress()->toArray();
    $email = $billingAddress['email'];
    $telephone = $billingAddress['telephone'];

What would be the variable name for pulling in the name and value of any money-off coupon that happens to be used for that order? I can't see any way of finding this out.

Solutions

You can use $order->getDiscountDescription();

For getting order coupon code used below code

$order->getCouponCode();

For Coupon description

$order->getDiscountDescription();

And Also getting order discount Price

$DiscountPrice=$order->getDiscountAmount();
Tags: Product / Coupon

Similar questions

Remove coupon code from new order email and insert label of coupon instead
Does anyone know how to edit the following to have the name of the coupon as the label on the new order sales email instead of the coupon code?
How do I find out what user used what coupon code?
I have a few coupon codes in my store, and I’d like to be able to track what code a user may have utilised. Inversely, is there a way to see how many times a particular code was used?
find all applied coupon code/rules for an order
Is it possible to find out all coupon codes was applied for an specific order? i can only found out 1 coupon codes was applied for an order in sales_flat_order table. In the table, only 1 field was storing a coupon code (last code applied). anyone know how to do that?
Coupon code auto generation unable to find
I have a coupon code that exists in magento (version 1.9.2.3). I think it it was created with auto generation. At least that is what I guess, because I cannot create a new one and I cannot find it using the filter in the admin panel. My question is: how can I find out which coupon that is? How can I search/filter them in the admin panel?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.