kenio Posted November 10, 2013 Share Posted November 10, 2013 Hi, i got little problem with changing place of order message textarea from address step to payment step. By default it's in step 3(address), but i would like to have it only in step 5 (payment). I tried to copy and delete this code from order-address.tpl {if !$opc} <div id="ordermsg" class="clearfix"> <p class="txt">{l s='If you would like to add a comment about your order, please write it below.'}</p> <p class="textarea"><textarea cols="60" rows="3" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p> </div> {/if} and paste it to order-payment.tpl, ofcourse textarea appears, but not save any written text in it, also not show written text in backend etc. Like it not exist. Is there any chance to get it work? i would appreaciate for any help, regards. Link to comment Share on other sites More sharing options...
vekia Posted November 10, 2013 Share Posted November 10, 2013 in order controller, in step 5 you need to add this simple code: if (Tools::isSubmit('message')) $this->_updateMessage(Tools::getValue('message')); Link to comment Share on other sites More sharing options...
kenio Posted November 10, 2013 Author Share Posted November 10, 2013 Hi, thanks for reply, in OrderController.php in payment step (i think it's 5th step) i added this code, but it still don't work end of my order-payment.tpl looks like that: {if $opc} <div id="opc_payment_methods-content"> {/if} <div id="HOOK_PAYMENT">{$HOOK_PAYMENT}</div> {if $opc} </div> {/if} {else} <p class="warning">{l s='No payment modules have been installed.'}</p> {/if} {if !$opc} <div id="ordermsg" class="clearfix"> <p class="txt">{l s='If you would like to add a comment about your order, please write it below.'}</p> <p class="textarea"><textarea cols="60" rows="3" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p> </div> {/if} {if !$opc} <p class="cart_navigation"><a href="{$link->getPageLink('order', true, NULL, "step=2")}" title="{l s='Previous'}" class="button">« {l s='Previous'}</a> </p> {else} </div> {/if} </div> and OrderController.php : /** * Payment step */ protected function _assignPayment() { global $orderTotal; // Redirect instead of displaying payment modules if any module are grefted on Hook::exec('displayBeforePayment', array('module' => 'order.php?step=3')); /* We may need to display an order summary */ $this->context->smarty->assign($this->context->cart->getSummaryDetails()); $this->context->smarty->assign(array( 'total_price' => (float)($orderTotal), 'taxes_enabled' => (int)(Configuration::get('PS_TAX')) )); $this->context->cart->checkedTOS = '1'; parent::_assignPayment(); if (Tools::isSubmit('message')) $this->_updateMessage(Tools::getValue('message')); } Link to comment Share on other sites More sharing options...
vekia Posted November 10, 2013 Share Posted November 10, 2013 and you created message field inside the <form></form> ? Link to comment Share on other sites More sharing options...
kenio Posted November 11, 2013 Author Share Posted November 11, 2013 (edited) no, it wasn't in <form>, i tried to add it but it still don't work and i think know why, if my thinking is right, it should be in form as you said and with submit button? in that last step there is no submit button cause of choice of payment which is <a href> links where each one of them reffer to payment view where is order button.. If i want to have order message in that step i must somehow change choice of payment from <a> links to <input type="radio"> buttons, and then add order submit button. Am i right? Edited November 11, 2013 by kenio (see edit history) Link to comment Share on other sites More sharing options...
kenio Posted November 13, 2013 Author Share Posted November 13, 2013 Hi, i made some modifications, example what i got in code: <form id="payment" method="post"> {if !$opc} <div class="payment-right"> <div id="ordermsg" class="clearfix"> <p class="txt">{l s='If you would like to add a comment about your order, please write it below.'}</p> <p class="textarea"><textarea cols="60" rows="3" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p> </div> </div> {/if} <input type="submit" class="exclusive_large" value="{l s='Go to last order step'}" onClick="$('#payment').attr('action','{$base_dir_ssl}modules/paybynetpl/payment.php');" title="{l s='Go to last order step'}" /> </form> right now i got textarea in form and i got input type button for submitting to payment, it still don't work, i make form action onclick in button cause i got 3 same buttons and depends which payment is chosen, different action go on click. I have no idea why it don't save text from textarea in backend :/ Link to comment Share on other sites More sharing options...
Jacek Es Posted April 14, 2015 Share Posted April 14, 2015 (edited) I tried to achieve the same but in step 4 (Delivery) in PS 1.6.0.8 but it also didn't work. I added the following code to OrderController in step 4: if (Tools::isSubmit('message')) $this->_updateMessage(Tools::getValue('message')); Anyone managed to move the order message to other page than step 3? Edited April 14, 2015 by Jacek Es (see edit history) Link to comment Share on other sites More sharing options...
s.goluchowski Posted November 10, 2015 Share Posted November 10, 2015 (edited) Hello Is anyone of you made it work? Edited November 10, 2015 by s.goluchowski (see edit history) Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 22, 2017 Share Posted March 22, 2017 (edited) Hello, i do this to put message box in shopping-cart.tpl .... <form action="{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}" method="post"> <div id="ordermsg" class="form-group"> <label>{l s='If you would like to add a comment about your order, please write it in the field below.'}</label> <textarea class="form-control" cols="60" rows="6" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea> </div> <p class="text-right cart_navigation clearfix"> {*<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')|escape:'html':'UTF-8'}{else}{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}{/if}" class="button btn btn-default standard-checkout button-medium" title="{l s='Proceed to checkout'}"> <span>{l s='Proceed to checkout'} <i class="icon-chevron-right right"></i></span> </a>*} <button type="submit" name="postProcess" class="button btn btn-default button-medium"> <span>{l s='Proceed to checkout'}<i class="icon-chevron-right right"></i></span> </button> </p> </form> .... in OrderController.php public function postProcess() { if (Tools::isSubmit('message')) { $this->_updateMessage(Tools::getValue('message')); } // Update carrier selected on preProccess in order to fix a bug of // block cart when it's hooked on leftcolumn if ($this->step == 3 && Tools::isSubmit('processCarrier')) { $this->processCarrier(); } } work great for me in PS 1.6.11 Edited March 22, 2017 by Alexandre Carette (see edit history) 1 Link to comment Share on other sites More sharing options...
folkifoon Posted May 2, 2017 Share Posted May 2, 2017 Hello, in prestashop 1.7 there is not a order message option at all! What a shame! How can i integrate this in 1.7? Link to comment Share on other sites More sharing options...
Ramasgrey Posted December 6, 2017 Share Posted December 6, 2017 Is it possible to add one more order message textarea? Link to comment Share on other sites More sharing options...
Blessy_Preferred Posted March 15, 2021 Share Posted March 15, 2021 On 3/22/2017 at 2:13 AM, Alexandre Carette said: Hello, i do this to put message box in shopping-cart.tpl .... <form action="{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}" method="post"> <div id="ordermsg" class="form-group"> <label>{l s='If you would like to add a comment about your order, please write it in the field below.'}</label> <textarea class="form-control" cols="60" rows="6" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea> </div> <p class="text-right cart_navigation clearfix"> {*<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')|escape:'html':'UTF-8'}{else}{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}{/if}" class="button btn btn-default standard-checkout button-medium" title="{l s='Proceed to checkout'}"> <span>{l s='Proceed to checkout'} <i class="icon-chevron-right right"></i></span> </a>*} <button type="submit" name="postProcess" class="button btn btn-default button-medium"> <span>{l s='Proceed to checkout'}<i class="icon-chevron-right right"></i></span> </button> </p> </form> .... in OrderController.php public function postProcess() { if (Tools::isSubmit('message')) { $this->_updateMessage(Tools::getValue('message')); } // Update carrier selected on preProccess in order to fix a bug of // block cart when it's hooked on leftcolumn if ($this->step == 3 && Tools::isSubmit('processCarrier')) { $this->processCarrier(); } } work great for me in PS 1.6.11 Working in 1.6.11, thanks! Link to comment Share on other sites More sharing options...
DRMasterChief Posted May 5 Share Posted May 5 On 11/10/2013 at 6:18 PM, vekia said: in order controller, in step 5 you need to add this simple code: if (Tools::isSubmit('message')) $this->_updateMessage(Tools::getValue('message')); all these things above did not work for me any new solutions here? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now