Product Breadcrumb Trail

Hi All,

I am using the M2 theme Porto. After setting up the theme, one of the first things I noticed was the lack of breadcrumb trail when accessing a product page. The trail is there between categories, but stops on Product page. You are left with “Home -> Product”

Correct me if I am wrong, but I think I might have found online, this is by design of Magento 2 code and not theme?

If I am correct, and the standard breadcrumb setting is not to leave a full trail on product page, Does anyone know of a decent resolution so you get the full trail all the way to product page?

I believe there is an extension for $25, but I would expect full breadcrumbs to be available as apart of base code. Afterall, the easy of navigation for visitor is important and I believe there are some SEO bonuses as well.

Thanks in advance!

This is correct. Not sure why.

I do have a fix for this somewhere, as I also use Porto. Try this (Disclaimer: Not what I’m using but it might help)

If that doesn’t work, I’ll dig out my own fix tomorrow.

Hi,

I did come across this one. But was put off as it mentions its no longer being supported. Creating backups now and I will give it ago!

Thanks

Tried installing with composer and now I get the following error in Extension manager.

BlockquoteCommand “show” failed: In Git.php line 393: Failed to execute git clone --mirror ‘git@github.com:CompactCodeEU/FixProdu ctBreadcrumbs.git’ ‘/var/www/html/var/composer_home/cache/vcs/git-github.co m-CompactCodeEU-FixProductBreadcrumbs.git/’ Cloning into bare repository ‘/var/www/html/var/composer_home/cache/vcs/git -github.com-CompactCodeEU-FixProductBreadcrumbs.git’… Could not create directory ‘/var/www/.ssh’. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. show [–all] [-i|–installed] [-p|–platform] [-a|–available] [-s|–self] [-N|–name-only] [-P|–path] [-t|–tree] [-l|–latest] [-o|–outdated] [–ignore IGNORE] [-m|–minor-only] [-D|–direct] [–strict] [-f|–format FORMAT] [–] [ []]

Removed using Composer but error remains. So attempting to rollback database. However I get a new error,

DB rollback is starting…
Multiple queries can’t be executed. Run a single query and try again.

I know its not related to frontend, just thought I would update with my progress.

Here’s my version. I haven’t tested it recently though.

Thanks.

I will give it a test if i ever fix the extension manager error!

Thought it was something I could remove from composer.json but didn’t help.

On the first one you tried, try:

composer remove compactcode/fixproductbreadcrumbs:dev-master
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy en_US en_GB -f
bin/magento clean:cache

Alternatively, look for any references to “git@github.com:CompactCodeEU/FixProductBreadcrumbs.git” in the composer.json file and remove manually.

Good luck and enjoy your weekend.

Hope you have a good weekend as well! I know I will be busy!

In the end, manual cleanup did the job fine! Wanted to avoid that, as I am learning my way around composer. (This is first attempt to use composer and custom addons)

Trying to test your version, I was able to load the repository via composer, however when trying to install I get an error. Maybe i am just attempting this too early without enough coffee.

Composer config

Blockquote composer config repositories.DigitalStartupUKDigitalStartup_PortoCrumbs git git@github.com:DigitalStartupUK/DigitalStartup_PortoCrumbs.git

Composer.json View

Blockquote },
“DigitalStartupUKDigitalStartup_PortoCrumbs”: {
“type”: “git”,
“url”: “git@github.com:DigitalStartupUK/DigitalStartup_PortoCrumbs.git”
}

Require request.

Blockquote composer require DigitalStartupUK/DigitalStartup_PortoCrumbs dev-master

Error Message

Blockquote [Composer\Repository\InvalidRepositoryException]
No valid composer.json was found in any branch or tag of git@github.com:DigitalStartupUK/DigitalStartup_PortoCrumbs.git, could not load a package from it.

My version was only designed to download from github and upload to app/code/. A bit half-arsed but it was a rush. Once uploaded via FTP you should be good to run bin/magento setup:upgrade without using composer. Sorry for confusion.

That seems to work great.

Tested about a dozen products and didn’t locate any errors! So great work! Thanks for sharing and putting up with my mistakes!

Hi Craig,
I’m having no luck installing your module to show the breadcrumbs on the Porto theme product page. As its my first time using Github i just wanted to be sure i was doing it correctly.
I’ve unzipped the folder DigitalStartup_PortoCrumbs-master and with Filezilla copied the DigitalStartup folder and contents across to the app/code/ folder.
Is that what i should be doing?
So i have app/code/DigitalStartup/PortoCrumbs… on my server.

However when in Putty connected as the magento user and i enter the commande :
bin/magento enable:module DigitalStartup_PortoCrumbs

I get the following message : There are no commands defined in the “enable” namespace.

Any idea what i’m doing wrong?
Thanks. Andy.

My bad… It’s

bin/magento module:enable DigitalStartup_PortoCrumbs

not

bin/magento enable:module DigitalStartup_PortoCrumbs

I fixed the typo. Try that.

Thanks for the reply Craig.

Yes that works great and does show the breadcrumbs when i land on the product page from going through the categories…Excellent!

However for example. If i have the product on the home page and click on it the product i have the trail : HOME>Product.
And the same if i arrive on a product from Google.

Is there a way of showing HOME>Category>Category>Product as the breadcrumb trail when arriving directly on the product page (from either my site or an external source)?

And any idea how to get the breadcrumbs showing on the mobile view of the Porto theme?

Thanks again.

You’d have to experiment yourself. I didn’t come up with this fix myself. I just packaged it for distribution. Glad it still works though.