Jump to content

How to display customer "private note" indicator on "Orders" tab


noesac

Recommended Posts

  • 3 months later...

Hi noesac,

I've done it, on 1.5.4.

 

Go to controllers/admin/AdminCustomersController.php

 

Starting around line 78 you will see all the columns, they look like this:

'id_gender' => array(
   'title' => $this->l('Title'),
   'width' => 70,
   'align' => 'center',
   'icon' => $genders_icon,
   'orderby' => false,
   'type' => 'select',
   'list' => $genders,
   'filter_key' => 'a!id_gender',
  ),
  'lastname' => array(
   'title' => $this->l('Last name'),
   'width' => 'auto'
  ),
  'firstname' => array(
   'title' => $this->l('First Name'),
   'width' => 'auto'
  ),

and so on...

 

I simply copy and pasted this after the 'email address' section:

'note' => array(
   'title' => $this->l('Note'),
   'width' => 140,
  ),

 

and it worked!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

A note to jaimeweb's solution (which works perfectly for 1.5.x):

 

You have to paste

 

'note' => array(
'title' => $this->l('Note'),
'width' => 140,
  ),

 

In AdminOrdersController.php at around line 100. You can decide the position your self, I pasted it after

 'payment' => array(
  'title' => $this->l('Payment: '),
  'width' => 100
 ),

Edited by Carlsen (see edit history)
Link to comment
Share on other sites

I'm on v1.4.10 and that file doesn't exist:(

ps1.4

admin/tabs/AdminXyzzzzz.php

is analagous to

ps1.5

controllers/admin/AdminXyzzzzzController.php

 

You'll find the code you're looking for in

admin/tabs/AdminCustomers.php

within the "fieldsDisplay" array declaration

$this->fieldsDisplay = array(

 

Personally, I would just write it out to a single line (in contrast to the multiline format suggested in earlier posts)

'note' => array('title' => $this->l('Note'), 'width' => 140, 'align' => 'left'),

 

FWIW, you can control where (leftmost? to the right of 'email' column? etc) the new 'note' column will display.

(For each of the "admin tab pages", the order in which you declare the fields determines left-to-right column order of the resulting html data table.)

Edited by blue17 (see edit history)
Link to comment
Share on other sites

  • 5 months later...

ps1.4

admin/tabs/AdminXyzzzzz.php

is analagous to

ps1.5

controllers/admin/AdminXyzzzzzController.php

 

You'll find the code you're looking for in

admin/tabs/AdminCustomers.php

within the "fieldsDisplay" array declaration

$this->fieldsDisplay = array(
Personally, I would just write it out to a single line (in contrast to the multiline format suggested in earlier posts)

'note' => array('title' => $this->l('Note'), 'width' => 140, 'align' => 'left'),
FWIW, you can control where (leftmost? to the right of 'email' column? etc) the new 'note' column will display.

(For each of the "admin tab pages", the order in which you declare the fields determines left-to-right column order of the resulting html data table.)

 

 

Thanks! I didn't even realise I had a reply! That worked. 

Hi,

 

I search the way to put private note on order,

Anybody can help me ? 

 

Yes I'm wondering this too. The solution provided is to display it on the Customer tab, which is nice, but more useful would be the Orders tab as per my original post. 

  • Like 1
Link to comment
Share on other sites

For Order tab, in admin/themes/default/template/controllers/orders/helpers/view/view.tpl

 

You have that :

{if $customer->id}
<!-- Customer informations -->
<br />
<fieldset>
<legend><img src="../img/admin/tab-customers.gif" /> {l s='Customer information'}</legend>
<span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
(<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
{if ($customer->isGuest())}
{l s='This order has been placed by a guest.'}
{if (!Customer::customerExists($customer->email))}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$order->id_lang}" />
<p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform a guest into a customer'}" /></p>
{l s='This feature will generate a random password and send an email to the customer.'}
</form>
{else}
<div><b style="color:red;">{l s='A registered customer account has already claimed this email address'}</b></div>
{/if}
{else}
{l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br />
{l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br />
{l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
</fieldset>
{/if}
{/if}

Modify with that : 

{if $customer->id}
<!-- Customer informations -->
<br />
<fieldset>
<legend><img src="../img/admin/tab-customers.gif" /> {l s='Customer information'}</legend>
<span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
(<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
{if ($customer->isGuest())}
{l s='This order has been placed by a guest.'}
{if (!Customer::customerExists($customer->email))}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$order->id_lang}" />
<p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform a guest into a customer'}" /></p>
{l s='This feature will generate a random password and send an email to the customer.'}
</form>
{else}
<div><b style="color:red;">{l s='A registered customer account has already claimed this email address'}</b></div>
{/if}
{else}
{l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br />
{l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br />
{l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
</fieldset>
{/if}
{if $customer->note}
<br />
<fieldset>
<legend><img src="../img/admin/tab-customers.gif" />Customer Note</legend>
<span style="font-weight: bold; font-size: 14px;">{$customer->note}</span>
</fieldset>
{/if}
{/if}
Edited by semor (see edit history)
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...