Ultimo theme, missing category in breadcrumbs navigation on product pages Magento 2.3

Struggling to get the breadcrumbs show the category in Magento 2.3 using Ultimo Theme megamenu. Here is the solution.

Magento 2.3 breadcrumbs depend heavily on the navigation menu’s (smart or not). Ultimo doesn’t follow this structure, and doesn’t seem to be updated anymore.

There are a few methods mentioned on forums overriding the core breadcrumbs structure completely, but I feel for Ultimo the best way is to make changes to the Megamenu.

Make changes to these two files:

/app/code/Infortis/UltraMegamenu/Block/Navigation.php
Where it says:

$itemClasses = ["nav-item"];

change to:

$itemClasses = ["category-item nav-item"];

app/code/Infortis/UltraMegamenu/view/frontend/templates/mainmenu.phtml

change to:

This way, the core Magento javascript breadcrumbs method stays as is. Increased compatiblity with other plugins.

This also works for the side menu’s.

You might want to override these in your custom theme, but I doubt Ultimo will ever be updated.

Did you like this solution or have an improvement? Let me know in the comments below. Thanks!

By the way, by multiple requests I also added the fix for the compat.js error in Magento 2.3.5 with Ultimo Theme.