I would like to add a class based on the field value I used in commerce order view. I have tried a solution from here I have installed "devel" module and already enabled it. However, I cannot find the dpm() result from my admin order page. I don't know if it is because of my code or dpm() function.
Here is my code and put them in my theme's template.php file::
function MYTHEME_preprocess_views_view_list(&$vars) {
if ($vars['view']->name == 'commerce_backoffice_orders' && $vars['view']->current_display == "Admin Page") {
dpm($vars); //uncomment to see variables
foreach($vars['view']->result as $key => $value){
$timestamp = $value->node_created;
if ($timestamp) { // add whatever conditional logic you need here
$vars['classes_array'][$key] .= ' hello'; // note the space in front of class
}
}
}
}
Does anyone have any idea about my issue? Thank you for anyone's help~~~~