first you have to create a new method in the OrderReturnStat class. I'll guide you to reach the objective.
Create a new file name OrderReturnState.php
in prestashop/override/classes/order/
:
class OrderReturnState extends OrderReturn {
public static function getOrderStateColor($id_order_return_state) {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT color FROM `'._DB_PREFIX_.'order_return_state` WHERE id_order_return_state = '.(int)$id_order_return_state.'');
}
}
After of that you have to create another file, I don't paste here because is too long, copy and paste this file
prestashop/youradminfolder/themes/default/template/helpers/list/list_content.tpl
in
prestashop/youradminfolder/themes/default/template/controllers/return/helpers/list/
now change your posted code in this
{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{elseif $statecolor = OrderReturnState::getOrderStateColor($tr.state)}style="background-color: {$statecolor}"{/if}
After of this operations delete this file prestashop/cache/class_index.php
Now your rows are with background color of return state.