kicsiburcsi Posted December 19, 2013 Share Posted December 19, 2013 Hi All, A minor annoyance, but a rather important one.. The shop I am currently building does not display the entier product name inwhen you view them in the category. It displays the beginning and then dots after that. E.g. This is how it should be: "Long product name because it is long" This is how it is doing it: "Long product..." It would be rather important to overcome this issue as the shop has many similar products with differences only in taste, but not look. www.kolbaszaruhaz.hu if someone wants to have a look. I have also attached a picture where I have outlined the issue with red and black :-) Thx All for reading it. Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 Hi. You need to edit product-list.tpl, locate: <h3>{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}<a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h3> By changing the number after 'truncate' you can set the length of the text. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Robin, Thanks for the quick reply, I will try it a bit later and will mark it as solved if that works. Thanks for your time :-) Tamás Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 Tamás, you have nice sausages there Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Robin, I have changed it with no effect. :-( It was set to 35 (i guesss that is the default) so it should have shown more anyway Some products shows it all and some just a few digits... Regards Tamás Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 (edited) Do you have compilation turned on? Are you trying to change it on the home page or on the product list? More information on the truncate function: http://www.smarty.net/docsv2/en/language.modifier.truncate Regards.Robin.The CartExpert Team Edited December 19, 2013 by CartExpert.net (see edit history) Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Robin, I will check it out. Thanks for the compliment, thez are nice hungarian sausages indeed....( well I am hungarian, as you have probably guessed. Thanks and I will let you know about my progress... Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Robin, Where can I turn on and off these? Should thez be turned off or on? I have found a file which I have pasted below.. it is the smarty.config.inc.php file Would you mind to take a look at it??? Thanks the file: <?php/** 2007-2013 PrestaShop** NOTICE OF LICENSE** This source file is subject to the Open Software License (OSL 3.0)* that is bundled with this package in the file LICENSE.txt.* It is also available through the world-wide-web at this URL:* http://opensource.org/licenses/osl-3.0.php* If you did not receive a copy of the license and are unable to* obtain it through the world-wide-web, please send an email* to [email protected] so we can send you a copy immediately.** DISCLAIMER** Do not edit or add to this file if you wish to upgrade PrestaShop to newer* versions in the future. If you wish to customize PrestaShop for your* needs please refer to http://www.prestashop.com for more information.** @author PrestaShop SA <[email protected]>* @copyright 2007-2013 PrestaShop SA* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)* International Registered Trademark & Property of PrestaShop SA*/define('_PS_SMARTY_DIR_', _PS_TOOL_DIR_.'smarty/');require_once(_PS_SMARTY_DIR_.'Smarty.class.php');global $smarty;$smarty = new Smarty();$smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile');$smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache');if (!Tools::getSafeModeStatus()) $smarty->use_sub_dirs = true;$smarty->setConfigDir(_PS_SMARTY_DIR_.'configs');$smarty->caching = false;$smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false;$smarty->compile_check = (Configuration::get('PS_SMARTY_FORCE_COMPILE') <= _PS_SMARTY_CHECK_COMPILE_) ? true : false;// Production mode$smarty->debugging = false;$smarty->debugging_ctrl = 'NONE';if (Configuration::get('PS_SMARTY_CONSOLE') == _PS_SMARTY_CONSOLE_OPEN_BY_URL_) $smarty->debugging_ctrl = 'URL';else if (Configuration::get('PS_SMARTY_CONSOLE') == _PS_SMARTY_CONSOLE_OPEN_) $smarty->debugging = true;/* Use this constant if you want to load smarty without all PrestaShop functions */if (defined('_PS_SMARTY_FAST_LOAD_') && _PS_SMARTY_FAST_LOAD_) return;if (defined('_PS_ADMIN_DIR_')) require_once (dirname(__FILE__).'/smartyadmin.config.inc.php');else require_once (dirname(__FILE__).'/smartyfront.config.inc.php');smartyRegisterFunction($smarty, 'modifier', 'truncate', 'smarty_modifier_truncate');smartyRegisterFunction($smarty, 'modifier', 'secureReferrer', array('Tools', 'secureReferrer'));smartyRegisterFunction($smarty, 'function', 't', 'smartyTruncate'); // unusedsmartyRegisterFunction($smarty, 'function', 'm', 'smartyMaxWords'); // unusedsmartyRegisterFunction($smarty, 'function', 'p', 'smartyShowObject'); // Debug onlysmartyRegisterFunction($smarty, 'function', 'd', 'smartyDieObject'); // Debug onlysmartyRegisterFunction($smarty, 'function', 'l', 'smartyTranslate', false);smartyRegisterFunction($smarty, 'function', 'hook', 'smartyHook');smartyRegisterFunction($smarty, 'function', 'toolsConvertPrice', 'toolsConvertPrice');smartyRegisterFunction($smarty, 'function', 'dateFormat', array('Tools', 'dateFormat'));smartyRegisterFunction($smarty, 'function', 'convertPrice', array('Product', 'convertPrice'));smartyRegisterFunction($smarty, 'function', 'convertPriceWithCurrency', array('Product', 'convertPriceWithCurrency'));smartyRegisterFunction($smarty, 'function', 'displayWtPrice', array('Product', 'displayWtPrice'));smartyRegisterFunction($smarty, 'function', 'displayWtPriceWithCurrency', array('Product', 'displayWtPriceWithCurrency'));smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'displayPriceSmarty'));smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twicesmartyRegisterFunction($smarty, 'function', 'getAdminToken', array('Tools', 'getAdminTokenLiteSmarty'));smartyRegisterFunction($smarty, 'function', 'displayAddressDetail', array('AddressFormat', 'generateAddressSmarty'));smartyRegisterFunction($smarty, 'function', 'getWidthSize', array('Image', 'getWidth'));smartyRegisterFunction($smarty, 'function', 'getHeightSize', array('Image', 'getHeight'));function smartyDieObject($params, &$smarty){ return Tools:($params['var']);}function smartyShowObject($params, &$smarty){ return Tools:($params['var']);}function smartyMaxWords($params, &$smarty){ Tools::displayAsDeprecated(); $params['s'] = str_replace('...', ' ...', html_entity_decode($params['s'], ENT_QUOTES, 'UTF-8')); $words = explode(' ', $params['s']); foreach($words AS &$word) if(Tools::strlen($word) > $params['n']) $word = Tools::substr(trim(chunk_split($word, $params['n']-1, '- ')), 0, -1); return implode(' ', Tools::htmlentitiesUTF8($words));}function smartyTruncate($params, &$smarty){ Tools::displayAsDeprecated(); $text = isset($params['strip']) ? strip_tags($params['text']) : $params['text']; $length = $params['length']; $sep = isset($params['sep']) ? $params['sep'] : '...'; if (Tools::strlen($text) > $length + Tools::strlen($sep)) $text = Tools::substr($text, 0, $length).$sep; return (isset($params['encode']) ? Tools::htmlentitiesUTF8($text, ENT_NOQUOTES) : $text);}function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false, $charset = 'UTF-8'){ if (!$length) return ''; if (Tools::strlen($string) > $length) { $length -= min($length, Tools::strlen($etc)); if (!$break_words && !$middle) $string = preg_replace('/\s+?(\S+)?$/u', '', Tools::substr($string, 0, $length+1, $charset)); return !$middle ? Tools::substr($string, 0, $length, $charset).$etc : Tools::substr($string, 0, $length/2, $charset).$etc.Tools::substr($string, -$length/2, $length, $charset); } else return $string;}function smarty_modifier_htmlentitiesUTF8($string){ return Tools::htmlentitiesUTF8($string);}function smartyMinifyHTML($tpl_output, &$smarty){ $tpl_output = Media::minifyHTML($tpl_output); return $tpl_output;}function smartyPackJSinHTML($tpl_output, &$smarty){ $tpl_output = Media::packJSinHTML($tpl_output); return $tpl_output;}function smartyRegisterFunction($smarty, $type, $function, $params, $lazy = true){ if (!in_array($type, array('function', 'modifier'))) return false; // lazy is better if the function is not called on every page if ($lazy) { $lazy_register = SmartyLazyRegister::getInstance(); $lazy_register->register($params); if (is_array($params)) $params = $params[1]; // SmartyLazyRegister allows to only load external class when they are needed $smarty->registerPlugin($type, $function, array($lazy_register, $params)); } else $smarty->registerPlugin($type, $function, $params);}function smartyHook($params, &$smarty){ if (!empty($params['h'])) { $id_module = null; $hook_params = $params; if (!empty($params['mod'])) { $module = Module::getInstanceByName($params['mod']); if ($module && $module->id) $id_module = $module->id; unset($hook_params['mod']); } unset($hook_params['h']); return Hook::exec($params['h'], $hook_params, $id_module); }}function toolsConvertPrice($params, &$smarty){ return Tools::convertPrice($params['price'], Context::getContext()->currency);}/** * Used to delay loading of external classes with smarty->register_plugin */class SmartyLazyRegister{ protected $registry = array(); protected static $instance; /** * Register a function or method to be dynamically called later * @param $params function name or array(object name, method name) */ public function register($params) { if (is_array($params)) $this->registry[$params[1]] = $params; else $this->registry[$params] = $params; } /** * Dynamically call static function or method * * @param $name function name * @param $arguments function argument * @return mixed function return */ public function __call($name, $arguments) { $item = $this->registry[$name]; // case 1: call to static method - case 2 : call to static function if (is_array($item[1])) return call_user_func_array($item[1].'::'.$item[0], array($arguments[0], &$arguments[1])); else { $args = array(); foreach($arguments as $a => $argument) if($a == 0) $args[] = $arguments[0]; else $args[] = &$arguments[$a]; return call_user_func_array($item, $args); } } public static function getInstance() { if (!self::$instance) self::$instance = new SmartyLazyRegister(); return self::$instance; }} Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 You can turn on / off the compilation is the back office: Advanced Parametes -> Performance If 'Never recompile template files' is checked you will not see any modifications you made to the template files. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Soooooo Under the smarty settings it is set to regenerate the templates if thez have been modified. According to this they should be regenerated. The title looks fine if you view the products in the category, but on the home page some of them is okay and some of them is not You can see it on the main page of the site :-( Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 The products on the home page are not displayed by product-list.tpl, they are displayed by 'homefeatured' module, so you need to edit the 'homefeatured.tpl' Regards.Robin.The CartExpert Team 1 Link to comment Share on other sites More sharing options...
kicsiburcsi Posted December 19, 2013 Author Share Posted December 19, 2013 Robin, Yes, Yes,Yes !!!! It must be noted that I needed to edit the one in the custom template rather than the default. Thanks mate!!! Do appriciate your help and time. If the business kick is I will get you some sausages... There will be lot more than what it is in the shop now :-) Regards Tamás Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 19, 2013 Share Posted December 19, 2013 Yes, you need to edit it in the themes folder if it is overriden. Look forward to the saussage, Tamás Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now