Worked like a charm!
I can kind of see how it works: the <a></a> link value is only applied when count meets criteria, else echo breadcrumb text without link.
Thanks! This is great!
I save all these tweaks in a doc, and sometimes I learn enough from them to make similar changes to other files, so thanks for broadening my horizon another step! :-).
I had already slightly modified my breadcrumbs.tpl to remove the little house icon from the Home crumb.
So here is Sam's mod combined with my house-removal mod:
<?php
if ($breadcrumbs && count($breadcrumbs) > 1) {
$total = count($breadcrumbs);
$count = 1;
?>
<section class="breadcrumbs">
<h4 class="hidden"> </h4>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) {
$count = $count + 1;
?>
<li>
<?php if($count <= $total){ ?>
<a href="<?php echo $breadcrumb['href']; ?>">
<?php echo ($breadcrumb['text']); ?>
</a>
<?php } else { ?>
<?php echo ($breadcrumb['text']); ?>
<?php } ?>
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
Noobs: because the tpl mod above removes the hotlink from the breadcrumb for the active page, the color for the "cold" crumb will no longer be the hot color, so you may not need the css mod originally mentioned above unless you want to specify an entirely different color for the cold crumb.
So Sam.
Can you modify the seo-url generation code to include category in the seo product urls?
Example: instead of domain/product-seo-key, the seo url for each product page would be domain/category-seo-key/product-seo-key.
I have only done a cursory search for the proper file. I've looked at storefront/model/tool/seo_url.php, but I'm not sure that is the correct file.
I'm aware this will be a core edit. I currently have 4 core edits on my site, and a detailed list of how to replicate them in the event that they get overwritten by an update. So I don't mind adding another to the list.
Many thanks! This is great!