Advertisement
verygoodplugins

Untitled

Jun 9th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. $discount = (float) ($calc_totals - $order->get_total());
  2. if ( round($discount,2) > 0.00  ) {
  3.     $line_items[] = array('type' => 7, 'price' => -$discount, 'title' => 'Discount', 'description' => 'WooCommerce Coupon Code');
  4.     $calc_totals -= $discount;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement