Skip to content

Commit

Permalink
feat: add support address ID
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrdrvn committed Jun 8, 2020
1 parent 3e8ccaa commit 0ad1bde
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions catalog/controller/extension/d_vuefront/store/checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ public function createOrder($args)
{
$this->session->data['shipping_address'] = array();

$this->session->data['shipping_address_id'] = '';

foreach ($this->shippingAddress() as $value) {
$this->session->data['shipping_address'][$value['name']] = '';
}

$this->session->data['shipping_address_id'] = '';

$this->session->data['payment_address'] = array(
'custom_field' => array()
);
Expand Down Expand Up @@ -349,6 +353,9 @@ public function updateOrder($args)
}
}

$this->session->data['shipping_address_id'] = $args['shippingAddressId'];
$this->session->data['payment_address_id'] = $args['paymentAddressId'];

if (!empty($args['shippingMethod'])) {
$shipping = explode('.', $args['shippingMethod']);

Expand Down Expand Up @@ -388,6 +395,8 @@ public function confirmOrder()

$shippingAddress = $this->session->data['shipping_address'];
$paymentAddress = $this->session->data['payment_address'];
$shippingAddressId = $this->session->data['shipping_address_id'];
$paymentAddressId = $this->session->data['payment_address_id'];

$shippingMethod = $this->session->data['shipping_method'];

Expand Down Expand Up @@ -452,6 +461,20 @@ public function confirmOrder()
}

$this->load->model('account/customer');
$this->load->model('account/address');

if($paymentAddressId !== "") {
$paymentAddress = $this->model_account_address->getAddress($paymentAddressId);
var_dump($paymentAddress);
$paymentAddress['firstName'] = $paymentAddress['first_name'];
$paymentAddress['lastName'] = $paymentAddress['first_name'];
}

if($shippingAddressId !== "") {
$shippingAddress = $this->model_account_address->getAddress($shippingAddressId);
$shippingAddress['firstName'] = $shippingAddress['first_name'];
$shippingAddress['lastName'] = $shippingAddress['first_name'];
}

$order_data['customer_id'] = 0;
$order_data['customer_group_id'] = '';
Expand Down

1 comment on commit 0ad1bde

@sivakumarkoduru
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why var_dump($paymentAddress);

Please sign in to comment.