Jump to content

Recommended Posts

Posted (edited)

In version v2.3.4.1 CE Frozen how can I change the color of the customer comment in the admin orders section

Currently a couple of key postage instructions have been missed as it just blends in with the PayPal info

The high lighted section in the picture is what I would like to change the colour of

Capture.JPG

Edited by SCH_001

Share this post


Link to post
Share on other sites

You need to find the relevant bit of code in the admin/orders.php page and add <mark></mark> after the opening <td> and before the closing </td> if you want the whole bit of text highlighted, or you could try narrowing it down to just the line that you need highlighted.

I cant remember if mine is standard or whether its been changed but look for something similar to

<td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n" .

and change it to

<td class="smallText"><mark>' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</mark></td>' . "\n" .

Hopefully that will give you a bit of an idea where to look in the code, but I expect someone will be along soon to tell you the right way to do it.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites
Posted (edited)

Steve's suggestion would highlite all comments.

If you wish to highlite only the customers comment, the easiest way would be to add the html tags already when the customers comments are saved to the database.

In checkout_process.php around line 139, add the tags:

                          'comments' => '<mark>' . $order->info['comments'] . '</mark>');

You need to do this also for payment modules which pypass checkout_process.php order processing like paypal standard.

 

Then in admin/orders.php you have to remove "tep_db_output" in aprox. line 384:

             '        <td class="dataTableContent" valign="top">' . nl2br($orders_history['comments']) . '&nbsp;</td>' . "\n" .

 

And then in account_history_info.php you'll have to filter out the html tags with strip_tags() line 182:

        echo '      <p>' . (empty($statuses['comments']) ? '&nbsp;' : '<blockquote>' . nl2br(tep_output_string_protected(strip_tags($statuses['comments']))) . '</blockquote>') . '</p>';

You probably need to remove the tags also in the admin order update mails. I'll leave this to you to find out 🙂

Edited by raiwa

Share this post


Link to post
Share on other sites

There you go. I said there would be another way of doing it.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, 14steve14 said:

There you go. I said there would be another way of doing it.

 the point is making comments stands out, or only making customers comment stand out. 

If it was me, I would pick your solution. since both comments are equally important, and simple is always better.

 

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
4 hours ago, hungryfrank said:

 the point is making comments stands out, or only making customers comment stand out. 

If it was me, I would pick your solution. since both comments are equally important, and simple is always better.

 

OP Wants ONLY the customer comment to be highlited.

Share this post


Link to post
Share on other sites
Posted (edited)

@SCH_001,

The easiest way might be to add a check to Steve's solution which marks only the comments with status id=1 which is in a standard installation the status used for to add customer comments:

The whole block would look then like this (around lines 380-389 in FROZEN):

      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
        echo '      <tr class="dataTableRow">' . "\n" .
             '        <td class="dataTableContent" valign="top">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
             '        <td class="dataTableContent" valign="top">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
        if ($orders_history['orders_status_id'] == 1) {
          echo '        <td class="dataTableContent" valign="top"><mark>' . nl2br($orders_history['comments']) . '<mark>&nbsp;</td>' . "\n";
        } else {
          echo '        <td class="dataTableContent" valign="top">' . nl2br($orders_history['comments']) . '&nbsp;</td>' . "\n";          
        }
        echo '        <td class="dataTableContent" valign="top" align="right">';

 

Edited by raiwa

Share this post


Link to post
Share on other sites

Thank you all, it will take me a while to get some time to try these options but I will reply back with how it goes

Many thanks to all that gave input

Share this post


Link to post
Share on other sites

I may adapt this to show on my invoices as at present any order comments just sort of blend in. Something to look into.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites
Posted (edited)

Thank you @raiwa your code did the job.

image.png.274a3a09754fdb4ff32014b14bbba3fb.png

When there is no text there is a small yellow bar as if there is one character there, would this be easy to remove?
image.png.2995ce512f9c205eb3b45d64274fe406.png Not worried if not as what you have supplied is already a mega help


@burt also gave me the below code which highlights the full line if anyone would like this option

image.png.ec84d23f6262ae9264f702c407588aad.png
 

Find this:

        echo '      <tr class="dataTableRow">' . "\n"

Change to:

       $s = ($orders_history['orders_status_id'] == 1) ? ' style="background: lightblue;"' : null;
        echo '      <tr class="dataTableRow"' . $s . '>' . "\n"

 

image.png

Edited by SCH_001

Share this post


Link to post
Share on other sites
Posted (edited)
23 minutes ago, SCH_001 said:

When there is no text there is a small yellow bar as if there is one character there, would this be easy to remove?
image.png.2995ce512f9c205eb3b45d64274fe406.png Not worried if not as what you have supplied is already a mega help

 

Sorry there was a typo in my code, the closing (second) <mark> should be </mark>

          echo '        <td class="dataTableContent" valign="top"><mark>' . nl2br($orders_history['comments']) . '</mark>&nbsp;</td>' . "\n";

 

Edited by raiwa

Share this post


Link to post
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

×