Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Add Words Like "buy" Into Title Rate Topic   - - - - -

 
  • Alex4
  • Newbie
  • Trial users
  • Join Date: 12-Aug 21
  • 4 posts

Posted 16 September 2021 - 06:21 AM #1

Hello everyone

Please, help, I need to do dynamic generation for my product-titles to be like "*product name* + buy in *** shop"

I use this code to dynamically generate titles.
Please help, how to add words "buy in *** shop" in code?

Thanks in advance!

 

<?php
 
use Tygh\Registry;
 
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);
}
}
?>


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22247 posts

Posted 17 September 2021 - 05:52 AM #2

Please use

 

<?php


use Tygh\Registry;


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'] . __('product_title_suffix');
Registry::get('view')->assign('page_title', $page_title);
}
}
?>

then go to translations and add product_title_suffix language variable with the required value


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)