if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Tygh::$app[‘view’]->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Tygh::$app[‘view’]->assign(‘page_title’, $page_title);
}
}
* The modification will create the dynamic page title only for products with empty page_tile
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Tygh::$app[‘view’]->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Tygh::$app[‘view’]->assign(‘page_title’, $page_title);
}
}
* The modification will create the dynamic page title only for products with empty page_tile
* Tested on CS-Cart 4.8.1
PS: "My Changes" add-on needs to be active
Please feel free to ask any questions!
Keep on smiling,
---
Valentin part of hungryweb.net
Hi Valentin
I followed your instructions but received an error, the site would not load any product pages. I'm using version 4.2.3. Any ideas?
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Registry::get(‘view’)->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Registry::get(‘view’)->assign(‘page_title’, $page_title);
}
}
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Registry::get(‘view’)->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Registry::get(‘view’)->assign(‘page_title’, $page_title);
}
}
Great, thanks so much Valentin. This works perfectly! : )
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Registry::get(‘view’)->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Registry::get(‘view’)->assign(‘page_title’, $page_title);
}
}
Great, thanks so much Valentin. This works perfectly! : )
Hi again Valentin
I'd also like to automatically capitalize all my product titles eg. masport motor mower = Masport Motor Mower. I believe I would use UCWORDS() for this, but I'm not sure how to correctly incorporate this into the solution you have already provided above. If it's not too much trouble, are you able to show me how this is done?
I'd also like to automatically capitalize all my product titles eg. masport motor mower = Masport Motor Mower. I believe I would use UCWORDS() for this, but I'm not sure how to correctly incorporate this into the solution you have already provided above. If it's not too much trouble, are you able to show me how this is done?..
Please use:
use Tygh\Registry;
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Tygh::$app[‘view’]->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = ucwords(strtolower($product[‘product’]));
Tygh::$app[‘view’]->assign(‘page_title’, $page_title);
}
}
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
if ($mode == ‘view’ && !empty($_REQUEST[‘product_id’])) {
$product = Registry::get(‘view’)->getTemplateVars(‘product’);
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = $product[‘product’];
Registry::get(‘view’)->assign(‘page_title’, $page_title);
}
}
Great, thanks so much Valentin. This works perfectly! : )
Hi again Valentin
I'd also like to automatically capitalize all my product titles eg. masport motor mower = Masport Motor Mower. I believe I would use UCWORDS() for this, but I'm not sure how to correctly incorporate this into the solution you have already provided above. If it's not too much trouble, are you able to show me how this is done?
Thanks in advance
: )
Thank you so much Valentin, that's great. Working well. : )
Are your looking for safe and secured managed digital marketing services with access to seo tools ( Similar to SEMRUSH on regular basis
Connect with us for details discussion just send us Email for proposal and Free Audit report of your website
Along with our services all cs-cart users get Worth $150
1. Advanced SEO Addon
2. SEO for Tags for creating more related pages with better SEO URL
Just Send us Email at Rajesh@gsnindia.com
We will get back with Free Audit Report of your website and Complete Digital marketing plan.
We Assure of 100% Money back if no significant changes in your organic traffic Min Time for engagement is 6 Months. Our rates are very reasonable. and affordable,