Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Link back to parent categories


Recommended Posts

This a very quick mod of another mod that replaced the product / category's heading title (the "Let's see what we have here" with the current category's name.

I'm afraid i can't find the topic again so if you know who created the original or if it's you then please make yourself known!

The original used the breadcrumb to insert the current category as the product info title.


This places a link below the product or category title that links to it's parent.




Open catalog/includes/classes/breadcrumb.php


below (around line 20):


function breadcrumb() {

   function reset() {
     $this->_trail = array();





// start of added code for category/subcategory link
function lasturl() { $trail_size = sizeof($this->_trail); return

function lasttitle() { $trail_size = sizeof($this->_trail); return

// end of added code





Open catalog/index.php




<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>


It appears a few times...


Below it, or above, or wherever you want it insert this (put it anywhere you like, doesn't have to be near the product title:


<td class="back-one">Go back to <a href="<?php echo $breadcrumb->lasturl(); ?>"><?php echo $breadcrumb->lasttitle(); ?></a></td>


That's it!


Hope this helps someone.

Link to comment
Share on other sites

  • 7 months later...


This topic is now archived and is closed to further replies.

  • Create New...