Title: Order export
Last modified: January 20, 2020

---

# Order export

 *  Resolved [laangen](https://wordpress.org/support/users/laangen/)
 * (@laangen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/)
 * Hello.
 * Is it possible to export the discount voucher value in a seperate line ?
    Exemple
   Productprice is 10€ Customer has voucher with 3€
 * The export file must have one ligne with the product 10€ and a second ligne with-
   3€.
    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344077)
 * Hello
 * please, visit section [https://algolplus.com/plugins/code-samples/#add_product_rows](https://algolplus.com/plugins/code-samples/#add_product_rows)
   and review 2nd example.
 * you must adapt it , use **$order->get_items(‘coupon’) ** to add coupons
 *  Thread Starter [laangen](https://wordpress.org/support/users/laangen/)
 * (@laangen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344214)
 * Thanks, I tried it but isn’t function. The shipping is ok but no coupons
    Thanks
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344659)
 * Could you try this version ?
 *     ```
       //export coupons as Products 
       add_filter('woe_fetch_order_products', function ($products,$order,$labels, $format, $static_vals) {
       	$i = count ($products);
       	foreach ( $order->get_items('coupon') as $item_id=>$item ) {
       		$row = array();
       		$i++;
       		foreach ( $labels as $field => $label ) {
       			if ( $field == 'line_id' ) {
       				$row[ $field ] = $i;
       			} elseif ( $field == 'sku' ) {
       				$row[ $field ] = $item->get_code();
       			} elseif ( $field == 'name' ) {
       				$row['name'] = $item->get_name();
       			} elseif ( $field == 'qty' ) {
       				$row['qty'] = 1;
       			} elseif ( $field == 'item_price' ) {
       				$row['item_price'] = $item->get_discount();
       			} elseif ( $field == 'line_tax' ) {
       				$row['line_tax'] = $item->get_discount_tax();
       			} elseif ( $field == 'price' ) {
       				$row['item_price'] = $item->get_discount();
       			} elseif ( isset( $static_vals[ $field ] ) ) {
       				$row[ $field ] = $static_vals[ $field ];
       			} 
       		}
       		$products[] = $row;
       	}
       	return $products;
       }, 10, 5);
       ```
   
 *  Thread Starter [laangen](https://wordpress.org/support/users/laangen/)
 * (@laangen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344678)
 * Perfect, many thanks !!
    Just see now, can I make the price from the voucher 
   negativ?
    -  This reply was modified 6 years, 4 months ago by [laangen](https://wordpress.org/support/users/laangen/).
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344684)
 * you’re welcome
 *  Thread Starter [laangen](https://wordpress.org/support/users/laangen/)
 * (@laangen)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344706)
 * Sorry
 * Just see now, can I make the price from the voucher negativ?
    Regards
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12344734)
 * just replace
    `$item->get_discount()` with `- $item->get_discount()`
 *  [kalamia](https://wordpress.org/support/users/kalamia/)
 * (@kalamia)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12351477)
 * Please delete my Account here.
 * Thank you
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12351495)
 * no way , as I understand.
    [https://wordpress.org/support/topic/how-to-delete-my-account-2/](https://wordpress.org/support/topic/how-to-delete-my-account-2/)

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Order export’ is closed to new replies.

 * ![](https://ps.w.org/woo-order-export-lite/assets/icon-256x256.png?rev=1365554)
 * [Advanced Order Export For WooCommerce](https://wordpress.org/plugins/woo-order-export-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-order-export-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-order-export-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-order-export-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-order-export-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-order-export-lite/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [algol.plus](https://wordpress.org/support/users/algolplus/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/order-export-2/#post-12351495)
 * Status: resolved