|
|
@ -276,7 +276,7 @@ function send_order_data($order_id) { |
|
|
|
$customer_name = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); |
|
|
|
$customer_name = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); |
|
|
|
$customer_phone = $order->get_billing_phone(); |
|
|
|
$customer_phone = $order->get_billing_phone(); |
|
|
|
$customer_email = $order->get_billing_email(); |
|
|
|
$customer_email = $order->get_billing_email(); |
|
|
|
$order_total = $order->get_total(); |
|
|
|
$order_total = round_price_with_tax($order->get_total()); |
|
|
|
$order_comment = ''; |
|
|
|
$order_comment = ''; |
|
|
|
$utm = get_utm_data()['utm_source']; |
|
|
|
$utm = get_utm_data()['utm_source']; |
|
|
|
$url = ''; |
|
|
|
$url = ''; |
|
|
@ -288,7 +288,7 @@ function send_order_data($order_id) { |
|
|
|
// Используем get_total_tax() + get_total() для получения полной цены с НДС |
|
|
|
// Используем get_total_tax() + get_total() для получения полной цены с НДС |
|
|
|
$item_total_without_tax = $item->get_total(); |
|
|
|
$item_total_without_tax = $item->get_total(); |
|
|
|
$item_tax = $item->get_total_tax(); |
|
|
|
$item_tax = $item->get_total_tax(); |
|
|
|
$item_total_with_tax = round($item_total_without_tax + $item_tax); |
|
|
|
$item_total_with_tax = round_price_with_tax($item_total_without_tax + $item_tax); |
|
|
|
$order_comment .= sprintf( |
|
|
|
$order_comment .= sprintf( |
|
|
|
"%s x %s = %s\n", |
|
|
|
"%s x %s = %s\n", |
|
|
|
$product->get_name(), |
|
|
|
$product->get_name(), |
|
|
@ -303,7 +303,7 @@ function send_order_data($order_id) { |
|
|
|
$order_comment .= "\n=== ПРОМОКОДЫ ===\n"; |
|
|
|
$order_comment .= "\n=== ПРОМОКОДЫ ===\n"; |
|
|
|
foreach ($coupons as $coupon_code) { |
|
|
|
foreach ($coupons as $coupon_code) { |
|
|
|
$coupon = new WC_Coupon($coupon_code); |
|
|
|
$coupon = new WC_Coupon($coupon_code); |
|
|
|
$discount_amount = round($order->get_discount_total()); |
|
|
|
$discount_amount = round_price_with_tax($order->get_discount_total()); |
|
|
|
$order_comment .= "Промокод: {$coupon_code}\n"; |
|
|
|
$order_comment .= "Промокод: {$coupon_code}\n"; |
|
|
|
$order_comment .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n"; |
|
|
|
$order_comment .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n"; |
|
|
|
} |
|
|
|
} |
|
|
@ -360,7 +360,7 @@ function send_order_data($order_id) { |
|
|
|
$product_qty = $item->get_quantity(); |
|
|
|
$product_qty = $item->get_quantity(); |
|
|
|
$product_total_without_tax = $item->get_total(); |
|
|
|
$product_total_without_tax = $item->get_total(); |
|
|
|
$product_tax = $item->get_total_tax(); |
|
|
|
$product_tax = $item->get_total_tax(); |
|
|
|
$product_total_with_tax = round($product_total_without_tax + $product_tax); |
|
|
|
$product_total_with_tax = round_price_with_tax($product_total_without_tax + $product_tax); |
|
|
|
$product_sku = $product->get_sku(); |
|
|
|
$product_sku = $product->get_sku(); |
|
|
|
|
|
|
|
|
|
|
|
$formData["PRODUCT_{$product_index}_NAME"] = $product_name; |
|
|
|
$formData["PRODUCT_{$product_index}_NAME"] = $product_name; |
|
|
@ -386,7 +386,7 @@ function send_order_data($order_id) { |
|
|
|
$product_summary .= "=== ПРОМОКОДЫ ===\n"; |
|
|
|
$product_summary .= "=== ПРОМОКОДЫ ===\n"; |
|
|
|
foreach ($coupons as $coupon_code) { |
|
|
|
foreach ($coupons as $coupon_code) { |
|
|
|
$coupon = new WC_Coupon($coupon_code); |
|
|
|
$coupon = new WC_Coupon($coupon_code); |
|
|
|
$discount_amount = round($order->get_discount_total()); |
|
|
|
$discount_amount = round_price_with_tax($order->get_discount_total()); |
|
|
|
$product_summary .= "Промокод: {$coupon_code}\n"; |
|
|
|
$product_summary .= "Промокод: {$coupon_code}\n"; |
|
|
|
$product_summary .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n"; |
|
|
|
$product_summary .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n"; |
|
|
|
} |
|
|
|
} |
|
|
@ -443,7 +443,7 @@ function notify_order_paid($order_id) { |
|
|
|
'TITLE' => 'Заказ #' . $order_id . ' оплачен', |
|
|
|
'TITLE' => 'Заказ #' . $order_id . ' оплачен', |
|
|
|
'ORDER_ID' => $order_id, |
|
|
|
'ORDER_ID' => $order_id, |
|
|
|
'PAYMENT_METHOD' => $order->get_payment_method_title(), |
|
|
|
'PAYMENT_METHOD' => $order->get_payment_method_title(), |
|
|
|
'ORDER_TOTAL' => $order->get_total(), |
|
|
|
'ORDER_TOTAL' => round_price_with_tax($order->get_total()), |
|
|
|
'SOURCE' => 'WooCommerce', |
|
|
|
'SOURCE' => 'WooCommerce', |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|