verygoodplugins

Untitled

Sep 9th, 2021 (edited)
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1.         if ( $payment->tax > 0 ) {
  2.             $line_items[] = array(
  3.                 'type'        => 'tax',
  4.                 'price'       => $payment->tax,
  5.                 'title'       => 'Tax',
  6.                 'description' => '',
  7.             );
  8.         }
  9.  
  10.         if ( ! empty( $discount ) ) {
  11.             $line_items[] = array(
  12.                 'type'        => 'discount',
  13.                 'price'       => -$discount,
  14.                 'title'       => 'Discounts Applied',
  15.                 'description' => 'Used discount codes: ' . $payment->discounts,
  16.                 'code'        => $payment->discounts, // <-- new line
  17.             );
  18.         }
  19.  
  20.         $order_args = array(
  21.             'order_label'     => 'EDD Order #' . $payment_id,
  22.             'order_number'    => $payment_id,
  23.             'order_edit_link' => admin_url( 'post.php?post=' . $payment_id . '&action=edit' ),
  24.             'payment_method'  => $payment->gateway,
  25.             'user_email'      => $payment->email,
  26.             'products'        => $products,
  27.             'line_items'      => $line_items,
  28.             'total'           => $payment->total,
  29.             'currency'        => $payment->currency,
  30.             'currency_symbol' => '$',
  31.             'order_date'      => strtotime( $payment->get_meta( '_edd_completed_date' ) ),
  32.             'provider'        => 'easy-digital-downloads',
  33.             'user_id'         => $payment->user_id,
  34.         );
Add Comment
Please, Sign In to add comment