[-] FO : Fix bug #PSCFV-8183 lost order message in OPC

This commit is contained in:
gRoussac
2013-03-28 19:50:14 +01:00
parent 052d17c30d
commit 93baeff66c
3 changed files with 9 additions and 3 deletions
+5
View File
@@ -405,9 +405,11 @@ class OrderOpcControllerCore extends ParentOrderController
if (!$this->isLogged) if (!$this->isLogged)
{ {
$carriers = $this->context->cart->simulateCarriersOutput(); $carriers = $this->context->cart->simulateCarriersOutput();
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_EXTRACARRIER' => null, 'HOOK_EXTRACARRIER' => null,
'HOOK_EXTRACARRIER_ADDR' => null, 'HOOK_EXTRACARRIER_ADDR' => null,
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array( 'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
'carriers' => $carriers, 'carriers' => $carriers,
'checked' => $this->context->cart->simulateCarrierSelectedOutput(), 'checked' => $this->context->cart->simulateCarrierSelectedOutput(),
@@ -494,6 +496,7 @@ class OrderOpcControllerCore extends ParentOrderController
$wrapping_fees = $this->context->cart->getGiftWrappingPrice(false); $wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
$wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice(); $wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
$vars = array( $vars = array(
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
@@ -513,6 +516,7 @@ class OrderOpcControllerCore extends ParentOrderController
'delivery_option' => $delivery_option, 'delivery_option' => $delivery_option,
'address_collection' => $this->context->cart->getAddressCollection(), 'address_collection' => $this->context->cart->getAddressCollection(),
'opc' => true, 'opc' => true,
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array( 'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
'carriers' => $carriers, 'carriers' => $carriers,
'delivery_option_list' => $this->context->cart->getDeliveryOptionList(), 'delivery_option_list' => $this->context->cart->getDeliveryOptionList(),
@@ -538,6 +542,7 @@ class OrderOpcControllerCore extends ParentOrderController
)), )),
'carrier_block' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-carrier.tpl') 'carrier_block' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-carrier.tpl')
); );
Cart::addExtraCarriers($result); Cart::addExtraCarriers($result);
return $result; return $result;
} }
+3 -2
View File
@@ -1267,10 +1267,11 @@ a.iframe {font-weight:bold}
width:723px; width:723px;
border:1px solid #ccc border:1px solid #ccc
} }
#order-opc #opc_delivery_methods #message {
width: 757px;
}
#order-opc #opc_payment_methods {margin-bottom:20px} #order-opc #opc_payment_methods {margin-bottom:20px}
#order-opc #opc_payment_methods #opc_payment_methods-content p{margin:0} #order-opc #opc_payment_methods #opc_payment_methods-content p{margin:0}
.delivery_option_carrier td {width:200px} .delivery_option_carrier td {width:200px}
.delivery_option_carrier td + td {width:280px;} .delivery_option_carrier td + td {width:280px;}
.delivery_option_carrier td + td + td {width:200px} .delivery_option_carrier td + td + td {width:200px}
+1 -1
View File
@@ -293,7 +293,7 @@
<h3>{l s='Leave a message'}</h3> <h3>{l s='Leave a message'}</h3>
<div> <div>
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p> <p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
<p><textarea cols="120" rows="3" name="message" id="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p> <p><textarea cols="120" rows="3" name="message" id="message">{if isset($oldMessage)}{$oldMessage|escape:'htmlall':'UTF-8'}{/if}</textarea></p>
</div> </div>
</div> </div>
{/if} {/if}