For example now is just category and product name
I want to show:
For category and subcategories:
Subcategory name | Category name | Website Ttle
for products:
Product name | Subcategory name | Category name | Website Title
Even if it's not possible all thse i am pleased just with some universal keywords and website title.
How to do that?
Thanks you!
to create a Custom Extension for you on this. It's not a matter,
to be solved in a few minutes, better be aware of this ...
But you're very seldom around here, as it looks, so, you might
not know ...
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
change:
Code: Select all
if ($category_info) {
$data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $path)
);
}
Code: Select all
if ($category_info) {
$data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $path)
);
$main_cat_name = $category_info['name']; // set name for title
}
Code: Select all
$data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url)
);
Code: Select all
$data['breadcrumbs'][] = array(
'text' => $category_info['name'],
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url)
);
$sub_cat_name = $category_info['name']; // set name for title
Code: Select all
$this->document->setTitle($product_info['meta_title']);
Code: Select all
$dyn_title = $product_info['name'];
if (isset($sub_cat_name)) $dyn_title .= '|'.$sub_cat_name;
if (isset($main_cat_name)) $dyn_title .= '|'.$main_cat_name;
$dyn_title .= '|'.$this->config->get('config_name');
$this->document->setTitle($dyn_title);
you basically reuse the category names used for the breadcrumbs to construct the title instead of using the static product meta title.
Use the same principle in catalog/controller/product/category.php
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Thanks for your time helping me.letxobnav wrote: ↑Thu Oct 01, 2020 7:57 amin catalog/controller/product/product.php
change:to:Code: Select all
if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path) ); }
change:Code: Select all
if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path) ); $main_cat_name = $category_info['name']; // set name for title }
to:Code: Select all
$data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url) );
change:Code: Select all
$data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url) ); $sub_cat_name = $category_info['name']; // set name for title
to:Code: Select all
$this->document->setTitle($product_info['meta_title']);
Code: Select all
$dyn_title = $product_info['name']; if (isset($sub_cat_name)) $dyn_title .= '|'.$sub_cat_name; if (isset($main_cat_name)) $dyn_title .= '|'.$main_cat_name; $dyn_title .= '|'.$this->config->get('config_name'); $this->document->setTitle($dyn_title);
you basically reuse the category names used for the breadcrumbs to construct the title instead of using the static product meta title.
Use the same principle in catalog/controller/product/category.php
Unfortunately i followed step-by-step but still is not working.
I also cleaned all caches from opencart admin and from browser and tried with 2 browsers
Does it needs to do modifcations in product.twig files in theme folder?
I copied below all the code from catalog/controller/category.php
Attachments
no, and the changes you made are good so you either are running a non-default template which sets the title itself or you already have a modification of the product.php file.Does it needs to do modifcations in product.twig files in theme folder?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Yes I am working with Journal Theme, so it's not the default one, it's a premium.
https://www.journal-theme.com/
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: No registered users and 33 guests