Eutanasio Posted August 16, 2015 Share Posted August 16, 2015 (edited) Hello, I'd like to have another box parallel to the "Private Note" on the customer's orders so I can write things there that the customer can see in the front office on my-account.tpl. How can I do so? So far, I've duplicated what it's in: 1.- root>admin>themes>default>template>controllers>orders>helpers>view>view.tpl 2.- controllers/admin/AdminCustomerControllers.php 3.- Classes/Customer.php 4.- \js\admin.js But doesn't work, it doesn't save anything. When I try to save, it sends me to a blank page in miweb.com/admin/ajax.php Thanks for the help! Edited August 16, 2015 by omar2886 (see edit history) Link to comment Share on other sites More sharing options...
Eutanasio Posted August 16, 2015 Author Share Posted August 16, 2015 Had to apply changes in \js\admin.js as well, the same way as for "Note" Link to comment Share on other sites More sharing options...
bogdan90i Posted April 13, 2016 Share Posted April 13, 2016 Hello, Can you tell me how you did it? I want to actually add a second "Private note" in the customer information page in the backoffice and i duplicated the same files. To keep it simple i just created note2 and it does not work. For me the problem is that the second value is set as "undefined" I changed the .js file like this function saveCustomerNote(customerId){ var noteContent = $('#noteContent').val(); var noteContentform = $('#noteContentform').val(); var data = 'token=' + token_admin_customers + '&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer=' + customerId + '¬e=' + encodeURIComponent(noteContent) + '¬e2=' + encodeURIComponent(noteContentform); $.ajax({ type: "POST", url: "index.php", data: data, async : true, success: function(r) { if (r == 'ok') { $('#submitCustomerNote').attr('disabled', true); } showSuccessMessage(update_success_msg); } }); } Do you think you can help me? Link to comment Share on other sites More sharing options...
Eutanasio Posted April 14, 2016 Author Share Posted April 14, 2016 You also want it to appear in the front so the text you save in this new field will appear to your customers? Link to comment Share on other sites More sharing options...
bogdan90i Posted April 14, 2016 Share Posted April 14, 2016 (edited) Hello, No i do not but actually i found why the data was not saved in the database. In the AdminCustomersController.php i forgot to add $customer->note2 = $note2; after if (!empty($note) && !Validate::isCleanHtml($note)) { die('error:validation'); } And to add $note2 = Tools::htmlentitiesDecodeUTF8(Tools::getValue('note2')); After if ($this->tabAccess['edit'] === '1') { $note = Tools::htmlentitiesDecodeUTF8(Tools::getValue('note')); What i wanted to do is to create a form replicating the private notes and it worked. I don't think it's the cleanest way to do it but it's in developing mode. If anybody wants to make a form for the clients but to be able to see only by the employees then tell me and i will guide you as far as i got (i mean with the raw version). I needed it for example for a company that does service checking, here is a image of what i made: So as you can see, one big form that has a save at the end of it. I thank you for you help omar2886 Edited April 14, 2016 by bogdan90i (see edit history) 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