0

PrestaShop 1.6.1.20

PHP 5.6.37

Hi, I tried to install a new module on my website but i end up with this php error that i don't know how to debug.

[29-Nov-2018 15:58:11 Europe/Paris] PHP Notice:  Undefined index: prod in C:\wamp64\www\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 115

[29-Nov-2018 15:58:11 Europe/Paris] PHP Stack trace:

[29-Nov-2018 15:58:11 Europe/Paris] PHP   1. {main}() C:\wamp64\www\prestashop\index.php:0

[29-Nov-2018 15:58:11 Europe/Paris] PHP   2. DispatcherCore->dispatch() C:\wamp64\www\prestashop\index.php:28

[29-Nov-2018 15:58:11 Europe/Paris] PHP   3. ControllerCore->run() C:\wamp64\www\prestashop\classes\Dispatcher.php:367

[29-Nov-2018 15:58:11 Europe/Paris] PHP   4. IndexControllerCore->initContent() C:\wamp64\www\prestashop\classes\controller\Controller.php:189

[29-Nov-2018 15:58:11 Europe/Paris] PHP   5. HookCore::exec() C:\wamp64\www\prestashop\controllers\front\IndexController.php:40

[29-Nov-2018 15:58:11 Europe/Paris] PHP   6. HookCore::coreCallHook() C:\wamp64\www\prestashop\classes\Hook.php:548

[29-Nov-2018 15:58:11 Europe/Paris] PHP   7. HomecategoriesPlus->hookHome() C:\wamp64\www\prestashop\classes\Hook.php:591

[29-Nov-2018 15:58:11 Europe/Paris] PHP   8. ModuleCore->display() C:\wamp64\www\prestashop\modules\homecategoriesplus\homecategoriesplus.php:767

[29-Nov-2018 15:58:11 Europe/Paris] PHP   9. Smarty_Custom_Template->fetch() C:\wamp64\www\prestashop\classes\module\Module.php:2309

[29-Nov-2018 15:58:11 Europe/Paris] PHP  10. Smarty_Internal_TemplateBase->fetch() C:\wamp64\www\prestashop\classes\SmartyCustom.php:308

[29-Nov-2018 15:58:11 Europe/Paris] PHP  11. content_5bfffe83b6f704_96197512() C:\wamp64\www\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php:188

I've tried to look for 'prod' in smarty_internal_templatebase.php but i didn't found anything. would anyone have an idea about where to look and how to fix this ?

zieg
  • 1
  • 2

1 Answers1

0

Look at the module homecategoriesplus.php at line 767. Your debug says this. I think you just need to add a condition in your homecategoriesplus.tpl to check if the variable prod exists. Something like

{if isset($prod) && $prod}
    /*your code here*/
{/if}

or just set default value to the variable during creating it in the homecategoriesplus.php

Alexander Grosul
  • 1,814
  • 2
  • 11
  • 12