Jump to content

[solved] Changing order color in Prestashop 1.5 Back office


Recommended Posts

Hi there,

 

I'm having a hard times getting used to new Prestashop 1.5 Orders list.

 

In PS 1.4 all orders were colored based on the order status - that way I could easily navigate between orders just looking at the row.

 

In PS 1.5 only statuses are colored - not the rows themselves.

 

Does anyone here know how can I modify default prestashop 1.5 back office theme to get the look of 1.4 (in terms of fully colored rows) instead of white & grey row background?

 

Please, see the images for detail.

 

Thanks in advance!

post-230733-0-06707000-1357577695_thumb.png

post-230733-0-22136500-1357577702_thumb.png

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Alright, since nobody stopped by to help me out, I had managed to figure it out myself.

 

Should anyone else be seeking to do the same thing as I did, here is the hint ->

 

Open your_prestashop_root/classes/controller/AdminController.php

and change it from:

 

  Quote

protected $colorOnBackground;

 

to

 

  Quote

protected $colorOnBackground = true;

 

So far it seems to be working.

 

The next step I'm about to investigate is implementing correct order status colors into order history (at every order detail). If I happen to find that out, I'll post it down.

 

Feel free to give a shout if this helped you a bit.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...
  On 1/17/2013 at 2:07 AM, lucass said:

Alright, since nobody stopped by to help me out, I had managed to figure it out myself.

 

Should anyone else be seeking to do the same thing as I did, here is the hint ->

 

Open your_prestashop_root/classes/controller/AdminController.php

and change it from:

 

 

 

to

 

 

 

So far it seems to be working.

 

The next step I'm about to investigate is implementing correct order status colors into order history (at every order detail). If I happen to find that out, I'll post it down.

 

Feel free to give a shout if this helped you a bit.

 

thanks for the solution, it works like a charm :) i marked this topic as solved fot other forum members

Link to comment
Share on other sites

  • 10 months later...
  • 10 months later...
  • 10 months later...
  • 11 months later...

Works perfectly on 1.6.1.5. as well! Thank You so much lucass, been struggling with this for more than three days now - and it was that easy!

 

EDIT: ok, it won't work at first for some people - for this change to take effect, You need to find this file:

{main_dir}\admin\themes\default\css\admin-theme.css

 

and comment out these lines (kill preset background-color parameters):

.bootstrap .table tbody>tr>td{border-top:none;color:#666;/*background-color:#fff;*/padding:3px 7px;vertical-align:middle;word-wrap:nowrap;font-size:12px;border-bottom:solid 1px #EAEDEF}/*.bootstrap .table tbody>tr.odd>td{background-color:#FCFDFE}*/
Edited by sting5 (see edit history)
Link to comment
Share on other sites

  • 3 years later...
  On 10/6/2016 at 3:55 AM, sting5 said:

{main_dir}\admin\themes\default\css\admin-theme.css

 

and comment out these lines (kill preset background-color parameters):

 

.bootstrap .table tbody>tr>td{border-top:none;color:#666;/*background-color:#fff;*/padding:3px 7px;vertical-align:middle;word-wrap:nowrap;font-size:12px;border-bottom:solid 1px #EAEDEF}/*.bootstrap .table tbody>tr.odd>td{background-color:#FCFDFE}*/
Expand  

and

.bootstrap .table tbody>tr.odd>td{*/background-color:#FCFDFE*/}

.bootstrap .table tbody>tr:hover>td{font-weight: bold;}

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

  • 5 years later...
  • 1 month later...

Hello,

In PrestaShop 8.2 you need to do the following:

Edit the following file: src/PrestaShopBundle/Resources/views/Admin/Common/Grid/Blocks/table.html.twig

Replace line 54 (<tr>) with this code:

<tr {% if record.color is defined %} style="background-color: {{ record.color }}; color: #fff; font-weight: 600;" {% endif %}>

Once you refresh the page, the color should be displayed for the entire row, not only for the Order Status table cell.

The above code also makes the table cells' text white and bold as in many cases, the text would be hard to read. If you want to keep the text color as it was before, just replace the code on that line with:

<tr {% if record.color is defined %} style="background-color: {{ record.color }}" {% endif %}>

The result can be seen in my attached screenshot.

Screenshot from 2025-03-30 20-39-23.png

Link to comment
Share on other sites

Hello,

Have you also tried to clear the cache from Advanced Parameters -> Performance?

In my case, it worked without doing so, but I can see some other topics where people had to clear the cache before the .twig changes showed up.

Link to comment
Share on other sites

aaah yes, that did the trick! but the price still stays in way it was, interesting...

I tried white and black version, most of the line changed, but the color under "payment accepted" just doesnt give a damn about this :D

 

black.png

white.png

Link to comment
Share on other sites

Hello,

These two small inconveniences can be fixed through CSS.

You can edit the admin/themes/new-theme/public/theme.css (the override.css one does not seem to be loaded for this page, unfortunately) file and at the end of it add:

For the text color:

#order_filter_form .column-osname button {
   color: #fff !important;
}

As for the price one, the green bubble signals the fact that the order has an invoice. If you really want to hide it, add the following to the above css file:

#order_filter_form .column-total_paid_tax_incl .badge-success {
   padding-left: 0;
   background-color: inherit;
}

Once you save and clear the browser cache (ctrl/command + shift + r in Chrome), the changes should be visible.

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...