[-] BO : fix #PSCFV-3855

This commit is contained in:
lLefevre
2012-09-03 08:49:57 +00:00
parent 42a97dde57
commit 8ed9977f5e
2 changed files with 20 additions and 19 deletions
+11 -11
View File
@@ -72,7 +72,7 @@ class GuestTrackingControllerCore extends FrontController
$email = Tools::getValue('email'); $email = Tools::getValue('email');
if (empty($order_reference) && empty($order_id)) if (empty($order_reference) && empty($id_order))
$this->errors[] = Tools::displayError('Please provide your Order Reference'); $this->errors[] = Tools::displayError('Please provide your Order Reference');
else if (empty($email)) else if (empty($email))
$this->errors[] = Tools::displayError('Please provide your e-mail address'); $this->errors[] = Tools::displayError('Please provide your e-mail address');
@@ -134,7 +134,7 @@ class GuestTrackingControllerCore extends FrontController
*/ */
protected function assignOrderTracking($order_collection) protected function assignOrderTracking($order_collection)
{ {
$customer = new Customer((int)($order_collection->getFirst()->id_customer)); $customer = new Customer((int)$order_collection->getFirst()->id_customer);
$order_collection = ($order_collection->getAll()); $order_collection = ($order_collection->getAll());
@@ -144,22 +144,22 @@ class GuestTrackingControllerCore extends FrontController
foreach ($order_list as &$order) foreach ($order_list as &$order)
{ {
$order->id_order_state = (int)($order->getCurrentState()); $order->id_order_state = (int)$order->getCurrentState();
$order->invoice = (OrderState::invoiceAvailable((int)($order->id_order_state)) && $order->invoice_number); $order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number);
$order->order_history = $order->getHistory((int)$this->context->language->id, false, true); $order->order_history = $order->getHistory((int)$this->context->language->id, false, true);
$order->carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang)); $order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
$order->address_invoice = new Address((int)($order->id_address_invoice)); $order->address_invoice = new Address((int)$order->id_address_invoice);
$order->address_delivery = new Address((int)($order->id_address_delivery)); $order->address_delivery = new Address((int)$order->id_address_delivery);
$order->inv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_invoice->id_country); $order->inv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_invoice->id_country);
$order->dlv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_delivery->id_country); $order->dlv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_delivery->id_country);
$order->invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_invoice, $order->inv_adr_fields); $order->invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_invoice, $order->inv_adr_fields);
$order->deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_delivery, $order->dlv_adr_fields); $order->deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_delivery, $order->dlv_adr_fields);
$order->currency = new Currency($order->id_currency); $order->currency = new Currency($order->id_currency);
$order->discounts = $order->getCartRules(); $order->discounts = $order->getCartRules();
$order->invoiceState = (Validate::isLoadedObject($order->address_invoice) && $order->address_invoice->id_state) ? new State((int)($order->addressInvoice->id_state)) : false; $order->invoiceState = (Validate::isLoadedObject($order->address_invoice) && $order->address_invoice->id_state) ? new State((int)$order->addressInvoice->id_state) : false;
$order->deliveryState = (Validate::isLoadedObject($order->address_delivery) && $order->address_delivery->id_state) ? new State((int)($order->addressDelivery->id_state)) : false; $order->deliveryState = (Validate::isLoadedObject($order->address_delivery) && $order->address_delivery->id_state) ? new State((int)$order->addressDelivery->id_state) : false;
$order->products = $order->getProducts(); $order->products = $order->getProducts();
$order->customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart)); $order->customizedDatas = Product::getAllCustomizedDatas((int)$order->id_cart);
Product::addCustomizationPrice($order->products, $order->customizedDatas); Product::addCustomizationPrice($order->products, $order->customizedDatas);
$order->total_old = ($order->total_discounts > 0) ? (float)($order->total_paid - $order->total_discounts) : false; $order->total_old = ($order->total_discounts > 0) ? (float)($order->total_paid - $order->total_discounts) : false;
@@ -174,7 +174,7 @@ class GuestTrackingControllerCore extends FrontController
'shop_name' => Configuration::get('PS_SHOP_NAME'), 'shop_name' => Configuration::get('PS_SHOP_NAME'),
'order_collection' => $order_list, 'order_collection' => $order_list,
'return_allowed' => false, 'return_allowed' => false,
'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')), 'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'),
'is_guest' => true, 'is_guest' => true,
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC), 'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
+2 -1
View File
@@ -82,7 +82,8 @@
<input type="password" name="password" /> <input type="password" name="password" />
</p> </p>
<input type="hidden" name="id_order" value="{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="hidden" name="id_order" value="{if isset($order->id)}{$order->id}{else}{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'htmlall':'UTF-8'}{/if}{/if}{/if}" />
<input type="hidden" name="order_reference" value="{if isset($smarty.get.order_reference)}{$smarty.get.order_reference|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.order_reference)}{$smarty.post.order_reference|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<input type="hidden" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="hidden" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<p class="center"><input type="submit" class="exclusive_large" name="submitTransformGuestToCustomer" value="{l s='Send'}" /></p> <p class="center"><input type="submit" class="exclusive_large" name="submitTransformGuestToCustomer" value="{l s='Send'}" /></p>