Change Order Row background color

  • Posts: 129
  • Thank you received: 0
8 years 8 months ago #249514

-- HikaShop version -- : 3.5.6
-- Joomla version -- : 3.5.1

hi,
i'd like to change each order row background color upon status changes
for example the background color of row of a confirmed order would be green
created would be yellow and etc .

Please Log in or Create an account to join the conversation.

  • Posts: 26249
  • Thank you received: 4039
  • MODERATOR
8 years 8 months ago #249531

Hi,

You'll need to perform a view override to change the classname of the different rows ; and then thanks to some CSS you will be able to customize the background color.
www.hikashop.com/support/documentation/1...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 0
8 years 8 months ago #249673

hello,
thanks but i was talking about the admin order list page .

i think i have to modify this file :
admin/component/hika/view/ order/tmpl/listing.php

i need an if condition code like

if status = confirm 
background red; 
else if status = shipped
background blue 
and ...


thanks

Please Log in or Create an account to join the conversation.

  • Posts: 83927
  • Thank you received: 13584
  • MODERATOR
8 years 8 months ago #249675

Hi,

Yes, it's in that file.
Something like that :

<?php
if($row->order_status == 'confirmed'){
echo ' style="background-color: red !important;" ';
}elseif($row->order_status == 'shipped'){
echo ' style="background-color: blue !important;" ';
}else{
// ....
}

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 0
8 years 8 months ago #249773

hey, thanks i'm using this code to change the background of a complete row of and order.
check out this code on line 123 of admin/component/hika/view/ order/tmpl/listing.php

<?php
if($row->order_status == 'created'){
echo ' style="background-color: #bafcff !important; border: 2px solid #62b7bb !important;" ';
}elseif($row->order_status == 'confirmed'){
echo ' style="background-color: #bafcff !important; border: 2px solid #62b7bb !important;" ';
}elseif($row->order_status == 'cancelled'){
echo ' style="background-color: #bafcff !important; border: 2px solid #62b7bb !important;" ';
}elseif($row->order_status == 'refunded'){
echo ' style="background-color: #bafcff !important; border: 2px solid #62b7bb !important;" ';
}elseif($row->order_status == 'shipped'){
echo ' style="background-color: #bafcff !important; border: 2px solid #62b7bb !important;" ';
}elseif($row->order_status == 'delivered'){
echo ' style="background-color: #c5ff85 !important; border: 2px solid #6d9045 !important;" ';
}else{
// ....
}?>

the result is not what i'm looking for, i guess i have to some how define the order id that this row is about some where beside order_status
to seperate each row from outside and sync the background of the row and the order status inside !

Last edit: 8 years 8 months ago by nic7071.

Please Log in or Create an account to join the conversation.

  • Posts: 83927
  • Thank you received: 13584
  • MODERATOR
8 years 8 months ago #249800

Hi,

You should be able to put that code directly into the tr opening tag of the table in that view file and it should work.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
8 years 4 months ago #259211

Hello!
I paste the above code, and unfortunately it does not work at all. What am I doing wrong? :(
All configuration (in attachement) not work...

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26249
  • Thank you received: 4039
  • MODERATOR
8 years 4 months ago #259479

Hi,

I'm afraid that you didn't page the right code and you did not page it in the right place.
Please be careful, PHP is case-sensitive for the variable names.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
8 years 4 months ago #259501

Hi :) Thx for answer..
I paste this code to "admin/component/hika/view/order/tmpl/listing.php". Where should I paste the code that worked correctly?

Please Log in or Create an account to join the conversation.

  • Posts: 83927
  • Thank you received: 13584
  • MODERATOR
8 years 4 months ago #259513

Hi,

As I said in my previous message, you need that code in the tr tag there.
In your screenshots, I can see that you put the code either before the tr tag or after it, not inside it... like that:
<tr <?php ....PHP code.... ?>>
Also, you've used the variable name ORDER_STATUS. That's not valid. It should be order_status, as in the example I provided.

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Powered by Kunena Forum