Jump to content

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

Remove Truncate:40 For Product Names In Admin Area Rate Topic   - - - - -

 
  • Zahhar
  • Junior Member
  • Members
  • Join Date: 01-Nov 08
  • 28 posts

Posted 13 October 2019 - 09:28 AM #1

Currently all product names in the list of products in admin area (admin.php?dispatch=products.manage) are truncated to 40 characters. This creates a problem for merchant to manage his inventory when product names are long. 
 
Examples:
Both products "CEMO CUBE Diesel tank 5000L Outdoor Premium Plus" and "CEMO CUBE Dieseltank 5000L Outdoor Premium"gets truncated to "CEMO CUBE Dieseltank 5000L Outdoo..." and become indistinguishable from each other.  
 
In a long product name the last part of the name is the most important, but it is truncated. Admin area becomes unusable because of this issue.
 
Truncating is hardcoded in /design/backend/templates/views/products/manage.tpl template:

<a class="row-status" title="{$product.product|strip_tags}" href="{"products.update?product_id=`$product.product_id`"|fn_url}">{$product.product|truncate:40 nofilter}</a>

 
Indeed there is a hook products:manage_body that allows to change this. However, the hook is too wide: it includes the whole row of the table (more then 50 lines of template code). It makes very little sense to override the whole row just to get rid of truncating product name.
 
I hope CS-Cart developers would agree, that hardcoding anything into the source code is a bad idea, even if hook exists to fix it. Purpose of the hooks is, according to documentation, "provide a convenient way for add-ons to perform additional actions in the middle of the main flow." Adjusting truncations is not a good reason to employ addon and a hook.

 

Given this, I would suggest 3 options how to fix this issue:

 

1. Move "40" to the config.php as one of static options, where it can be redefined to any value  required by merchant (e.g. 999)

 

2. Introduce new checkbox in Admin area -> Settings ->Appearance that would enable/disable truncation of product names. It can also be a numeric field, where "0" means truncation disabled completely. 

 

3. Remove truncation from product names, so show them "as is". In this case those merchant who need truncation for some reason, would introduce it using a hook. You may add extra product_name hook to override only product names, if this makes sense. 

 

Please support. 


Boutique digital agency, marketing automation: bergdigital.ch