🇨🇴Colombia @kayograco

Account created on 20 June 2010, over 14 years ago
#

Recent comments

🇨🇴Colombia kayograco

I tried this code to put the class "my-profile" into the body, but it breaks the site when clicking on "Orders" "Commerce" tab.

function MYTHEME_preprocess_page(array &$variables) {
  $current_user = \Drupal::currentUser();  
  if ($user = \Drupal::routeMatch()->getParameter('user')) {
    if ($user->id() == $current_user->id()) {
      $variables['attributes']['class'][] = 'my-profile';
    }
  }
}
🇨🇴Colombia kayograco

It would be nice to have this functionality out of the box with Commerce Core module. I don't know how to install a patch so I will have this issue on my marketplace until is officially released.

Production build 0.71.5 2024