All my product titles are currently in all lowercase however in google results it doesn't seem to stand out as much as those with capitals.
So I was wondering if there is some css code or something that will automatically capitalize all words in my product titles, without me having to manually rewrite every single product?
or use My changes module and products.post.php controller to do it
Thanks a lot for the solution, I'm just wondering though, I only want to capitalize the first letter of each word... so would I need to use "ucwords()" somehow?
Thanks a lot for the solution, I'm just wondering though, I only want to capitalize the first letter of each word... so would I need to use "ucwords()" somehow?
Thanks a lot for the solution, I'm just wondering though, I only want to capitalize the first letter of each word... so would I need to use "ucwords()" somehow?
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);
}
with
if(empty($product[‘page_title’])){
//other data can be added to title dynamic also
$page_title = ucwords($product[‘product’]);
} else {
$page_title = ucwords($product[‘page_title’]);
}
Registry::get(‘view’)->assign(‘page_title’, $page_title);
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);
}
with
if(empty($product['page_title'])){
//other data can be added to title dynamic also
$page_title = ucwords($product['product']);
} else {
$page_title = ucwords($product['page_title']);
}
Registry::get('view')->assign('page_title', $page_title);
Thanks again for the response.
I found no change after making this edit, however was advised by another member to just change the one line to:
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);
}
with
if(empty($product['page_title'])){
//other data can be added to title dynamic also
$page_title = ucwords($product['product']);
} else {
$page_title = ucwords($product['page_title']);
}
Registry::get('view')->assign('page_title', $page_title);
Thanks again for the response.
I found no change after making this edit, however was advised by another member to just change the one line to:
Thank you for the message. Please note that that solution will not capitalise titles generated from product names. Our solution covers it
Yes, I have since added your solution, so we are all good! Thanks again...
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 = ucwords(strtolower($product['product']));
}
else {
$page_title = ucwords(strtolower($product['page_title']));
}
Woudn't you want to update $product['page_title'] and then re-assign $product also? While setting $page_title might work for the meta data in that page, other addons or other extensions to the page my reference the $product.page_title value.