From 9949e0fcea51059b044c2cd9f7bb5de4e96f6144 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Mon, 26 Jun 2017 14:35:15 +0200 Subject: [PATCH] Check coupon (#37) --- catalog/model/extension/retailcrm/order.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/catalog/model/extension/retailcrm/order.php b/catalog/model/extension/retailcrm/order.php index 09347f5..3a3a7a1 100644 --- a/catalog/model/extension/retailcrm/order.php +++ b/catalog/model/extension/retailcrm/order.php @@ -66,7 +66,7 @@ class ModelExtensionRetailcrmOrder extends Model { } } - $order['discount'] = $couponTotal; + if(isset($couponTotal)) $order['discount'] = $couponTotal; $order['createdAt'] = $order_data['date_added']; $payment_code = $order_data['payment_code']; @@ -209,8 +209,8 @@ class ModelExtensionRetailcrmOrder extends Model { $couponTotal = abs($totals['value']); } } - - $order['discount'] = $couponTotal; + + if(isset($couponTotal)) $order['discount'] = $couponTotal; $order['createdAt'] = $order_data['date_added']; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; @@ -227,8 +227,8 @@ class ModelExtensionRetailcrmOrder extends Model { 'address' => array( 'index' => $order_data['shipping_postcode'], 'city' => $order_data['shipping_city'], - 'country' => $order_data['shipping_country_id'], - 'region' => $order_data['shipping_zone_id'], + 'countryIso' => $order_data['shipping_iso_code_2'], + 'region' => $order_data['shipping_zone'], 'text' => implode(', ', array( $order_data['shipping_postcode'], $country,