diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 961712488..9c152b127 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -376,6 +376,9 @@ class OrderOpcControllerCore extends ParentOrderController $customer = $this->context->customer; $address_delivery = new Address($this->context->cart->id_address_delivery); + $id_address_invoice = $this->context->cart->id_address_invoice != $this->context->cart->id_address_delivery ? (int)$this->context->cart->id_address_invoice : 0; + $address_invoice = new Address($id_address_invoice); + if ($customer->birthday) $birthday = explode('-', $customer->birthday); else @@ -404,7 +407,21 @@ class OrderOpcControllerCore extends ParentOrderController 'id_gender' => (int)$customer->id_gender, 'sl_year' => $birthday[0], 'sl_month' => $birthday[1], - 'sl_day' => $birthday[2] + 'sl_day' => $birthday[2], + 'id_address_invoice' => $id_address_invoice, + 'company_invoice' => Tools::htmlentitiesUTF8($address_invoice->company), + 'lastname_invoice' => Tools::htmlentitiesUTF8($address_invoice->lastname), + 'firstname_invoice' => Tools::htmlentitiesUTF8($address_invoice->firstname), + 'vat_number_invoice' => Tools::htmlentitiesUTF8($address_invoice->vat_number), + 'dni_invoice' => Tools::htmlentitiesUTF8($address_invoice->dni), + 'address1_invoice' => Tools::htmlentitiesUTF8($address_invoice->address1), + 'address2_invoice' => Tools::htmlentitiesUTF8($address_invoice->address2), + 'postcode_invoice' => Tools::htmlentitiesUTF8($address_invoice->postcode), + 'city_invoice' => Tools::htmlentitiesUTF8($address_invoice->city), + 'phone_invoice' => Tools::htmlentitiesUTF8($address_invoice->phone), + 'phone_mobile_invoice' => Tools::htmlentitiesUTF8($address_invoice->phone_mobile), + 'id_country_invoice' => (int)($address_invoice->id_country), + 'id_state_invoice' => (int)($address_invoice->id_state), ); } diff --git a/themes/default/order-opc-new-account.tpl b/themes/default/order-opc-new-account.tpl index 35c38e773..add62a03b 100644 --- a/themes/default/order-opc-new-account.tpl +++ b/themes/default/order-opc-new-account.tpl @@ -180,13 +180,11 @@ {$stateExist = false} {$postCodeExist = false} {foreach from=$dlv_all_fields item=field_name} - {if $field_name eq "company"} - {if $b2b_enable} + {if $field_name eq "company" && $b2b_enable}
- {/if} {elseif $field_name eq "firstname"}
@@ -224,7 +222,7 @@
@@ -277,7 +275,7 @@- +
@@ -291,7 +289,7 @@ {assign var=postCodeExist value=false}@@ -305,39 +303,39 @@
- + {l s='DNI / NIF / NIE'}
{elseif $field_name eq "firstname"}- +
{elseif $field_name eq "lastname"}- +
{elseif $field_name eq "address1"}- +
{elseif $field_name eq "address2"}- +
{elseif $field_name eq "postcode"} {$postCodeExist = true}- +
{elseif $field_name eq "city"}- +
{elseif $field_name eq "country" || $field_name eq "Country:name"}@@ -345,7 +343,7 @@
@@ -382,11 +380,11 @@ {/if}- +
- +