Skip to content

Commit

Permalink
address fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timoj committed Jun 26, 2017
1 parent 46d74c5 commit 610dcb4
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions admin/controller/extension/module/wuunder.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function test()
$this->load->model('sale/order');
echo "<pre>";
// var_dump($this->model_sale_order->getOrder(19));
var_dump($this->separateAddressLine("Bohemen 79"));
var_dump($this->model_sale_order->getOrder(28));
echo "</pre>";
}

Expand All @@ -188,17 +188,22 @@ private function buildWuunderData($order_id)
$this->load->model('catalog/product');
$orderData = $this->model_sale_order->getOrder($order_id);
$orderProducts = $this->model_sale_order->getOrderProducts($order_id);
if (empty($orderData['shipping_address_1']) && !empty($orderData['payment_address_1'])) {
$field_prefix = "payment";
} else {
$field_prefix = "shipping";
}
$customerAdr = array(
'business' => $orderData['shipping_company'],
'business' => $orderData[$field_prefix.'_company'],
'email_address' => $orderData['email'],
'family_name' => $orderData['shipping_lastname'],
'given_name' => $orderData['shipping_firstname'],
'locality' => $orderData['shipping_city'],
'family_name' => $orderData[$field_prefix.'_lastname'],
'given_name' => $orderData[$field_prefix.'_firstname'],
'locality' => $orderData[$field_prefix.'_city'],
'phone_number' => $orderData['telephone'],
'street_name' => $this->separateAddressLine($orderData['shipping_address_1'])[0],
'house_number' => $this->separateAddressLine($orderData['shipping_address_1'])[1],
'zip_code' => $orderData['shipping_postcode'],
'country' => $orderData['shipping_iso_code_2']
'street_name' => $this->separateAddressLine($orderData[$field_prefix.'_address_1'])[0],
'house_number' => $this->separateAddressLine($orderData[$field_prefix.'_address_1'])[1],
'zip_code' => $orderData[$field_prefix.'_postcode'],
'country' => $orderData[$field_prefix.'_iso_code_2']
);

$pickupAdr = array(
Expand Down Expand Up @@ -236,7 +241,8 @@ private function buildWuunderData($order_id)
'personal_message' => $orderData['comment'],
'picture' => $orderPicture,
'customer_reference' => $order_id,
'value' => $totalValue ? $totalValue : $defValue,
// 'value' => $totalValue ? $totalValue : $defValue,
'value' => null,
'kind' => null,
'length' => $defLength,
'width' => $defWidth,
Expand Down

0 comments on commit 610dcb4

Please sign in to comment.