Daniel_96 Posted April 25, 2020 Share Posted April 25, 2020 Necesito incluir un color a mi transportista asi como se le agrega un color al Status del pedido: 'carrierdelay' => array( 'title' => $this->l('Envio'), 'type' => 'text', 'align' => 'text-center', 'class' => 'fixed-width-xl', 'filter_key' => 'carrier_lang!delay', 'filter_type' => 'text', 'order_key' => 'carrier_lang!delay' ), Si incluyo : 'color' => 'color', siempre obtengo el color del status de la orden, pero yo solo quier definir un color a mi transportista. Link to comment Share on other sites More sharing options...
idnovate.com Posted April 25, 2020 Share Posted April 25, 2020 Añade un callback: ... 'carrierdelay' => array( 'title' => $this->l('Envio'), 'type' => 'text', 'align' => 'text-center', 'class' => 'fixed-width-xl', 'color' => 'color', 'filter_key' => 'carrier_lang!delay', 'filter_type' => 'text', 'order_key' => 'carrier_lang!delay' 'callback' => 'colorCarrier' ), ... function colorCarrier($value, $object) { if ($object['carrierdelay'] > 3) { // Do the compare that you need, and set desired colors $backgroundColor = '#4169E1'; $color = 'white'; } // Return span with color and string return '<span class="label color_field" style="background-color:'.$backgroundColor.';color:'.$white.'">'.$this->l("Delayed").'</span>'; } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now