AggieS Posted June 25, 2013 Share Posted June 25, 2013 Hello! After adding second language to PrestaShop, I've got error in any item form. Notice: Undefined index: 2 in httpdocs/tools/smarty/plugins/function.declension.php on line 14 Here is code function smarty_function_declension ($params,&$smarty) { $totl = null; $expressions = explode(',',$params['expressions']); $count = $params['nb'] % 100; if ($count >= 5 && $count <= 20) { $result = $totl . ' ' . $expressions['2']; //HERE IS ERROR } else { $count = $count % 10; if ($count == 1) { $result = $totl . ' ' . $expressions['0']; } elseif ($count >= 2 && $count <= 4) { $result = $totl . ' ' . $expressions['1']; } else { $result = $totl . ' ' . $expressions['2']; } } return $result; } As I understood problem is with $expressions, it should be defined in case if there is no value. May be someone cloud help me with it? Link to comment Share on other sites More sharing options...
tuk66 Posted June 26, 2013 Share Posted June 26, 2013 Disable displaying notices in php.ini. Link to comment Share on other sites More sharing options...
AggieS Posted June 27, 2013 Author Share Posted June 27, 2013 Thanks for your answer. I know that it would be easier way how to fix this notice, but may be this value will be used later and there will be an error. So I'm trying to find "correct" solution. Link to comment Share on other sites More sharing options...
tuk66 Posted June 27, 2013 Share Posted June 27, 2013 I think it is wasting of time. PrestaShop and third-party modules have many bugs, warnings, notices. Link to comment Share on other sites More sharing options...
Recommended Posts