Jump to content

Poner color a mi transportista en AdminOrder


Daniel_96

Recommended Posts

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.
 

TRANSPORTISTA.PNG

Link to comment
Share on other sites

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>';
}

 

  • Thanks 1
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...