Post by Elle-Z » Wed Apr 03, 2013 4:50 am

Can someone put here same code to adding in title a breadcrumbs for v1.5.4.1
Please! :)

Newbie

Posts

Joined
Tue Mar 26, 2013 1:14 am

New member

Posts

Joined
Sun Dec 25, 2011 2:58 pm

Post by feriyanto » Sun Sep 29, 2013 7:10 am

working great on my website, check this out www.chantiqbutik.com
thanks

http://www.chantiqbutik.com
http://www.jasikom.com


Newbie

Posts

Joined
Tue May 22, 2012 3:10 am

Post by damic » Sat Oct 04, 2014 8:38 am

Open the header.php file (catalog/controller/common) change line 4 to something like this:

Code: Select all

		if($this->document->getTitle()!='')
		{
			$data['title'] = $this->config->get('config_name') . ' :: ' .$this->document->getTitle();
		}else{
			$data['title'] = $this->config->get('config_meta_title') ;
		}
Open your home.php (same directory), change line 4 to this:

Code: Select all

$this->document->setTitle('');

Newbie

Posts

Joined
Sat Oct 04, 2014 8:35 am

Post by petkon » Wed Jun 29, 2016 12:33 am

matteo84 wrote:
paola84 wrote:How can I make this modification in v1.4.7 ?
Hi Paola!
I'm new to OpenCart... so i don't know if this is the best way to solve the problem.

In /catalog/controller/view/theme/default/template/common/header.tpl approximately at line #5 you'll find

Code: Select all

<title><?php echo $title; ?></title>
Replace this line with this code...

Code: Select all

<title>
<?php
# BEGIN - titleBreadCrumbs
if(!empty($this->document->breadcrumbs)) {
    $titleBreadCrumbs = array();
    
    foreach($this->document->breadcrumbs as $breadcrumb) {
        if($breadcrumb['text'] != $this->language->get('text_home'))
        $titleBreadCrumbs[] = $breadcrumb['text'];
    }
    
    $titleBreadCrumbs = array_reverse($titleBreadCrumbs);
    
    echo implode(' - ', $titleBreadCrumbs) . ' - ';
}
echo $this->config->get('config_title');
# END - titleBreadCrumbs
?>
</title>
This should solve your problem. ;)

Regards.
Matteo
Hi guys! This code is not working on Opencart 2.2.0.0
Do you have any idea how can i fix it?

Newbie

Posts

Joined
Wed Jun 29, 2016 12:26 am

Post by pipepiper » Sun Oct 23, 2016 8:19 pm

For 2.2, you DO NOT need to do $this->config->get as this is already included in the header controller.
just replace

Code: Select all

$this->config->get('config_name')
with

Code: Select all

$name
Hope this helps someone struggling with getting this to work in 2.2.

Newbie

Posts

Joined
Fri Apr 20, 2012 6:26 pm

Post by sinners » Fri Jul 06, 2018 2:03 am

mogwaycz wrote:
Thu Jan 26, 2012 11:09 am
For OC 1.5.1.3:

in catalog/controller/product/product.php find:

Code: Select all

$this->document->setTitle($product_info['name']);
and replace:

Code: Select all

if (isset($product_info['manufacturer'])) {
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name'] . ' od ' . $product_info['manufacturer']);
			}
			else
			{
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name']);
      }
in catalog/controller/product/category.php find:

Code: Select all

$this->document->setTitle($category_info['name']);
and replace:

Code: Select all

$this->document->setTitle('YOURDOMAIN.XYZ - ' . $category_info['name']);
That's all...

;)
Nice1, finally got it to work with this, how would i change it so domain comes after category and product info, Thanks.

Newbie

Posts

Joined
Thu Jul 05, 2018 4:59 am
Who is online

Users browsing this forum: No registered users and 7 guests