wstar Posted August 11, 2015 Share Posted August 11, 2015 We have a fresh install of Prestashop 1.6.1 and made a few products, giving them color options. Some products have this error, others do not. I can't find any relationship between the products that display the error and the ones that do not. Notice: Undefined index: colors_list in C:\LGSRoot\prestaLGS01\web\cache\smarty\compile\8d\f8\d6\8df8d63f517dbbc10131b282caed982e6a9bc5a9.file.product-list-colors.tpl.cache.php on line 34 Notice: Trying to get property of non-object in C:\LGSRoot\prestaLGS01\web\cache\smarty\compile\8d\f8\d6\8df8d63f517dbbc10131b282caed982e6a9bc5a9.file.product-list-colors.tpl.cache.php on line 34 I've tried to clear the cache as noted on these forums. I've tried to remove the color attributes and remake. Nothing seems to work. When I clear the cache, the errors go away on a refresh. Once I refresh a second time, the errors come back. Link to comment Share on other sites More sharing options...
swh Posted August 16, 2015 Share Posted August 16, 2015 Same problem here. I tried clearing class_index.php and cache - it helps for a minute but same error returns after refreshing webpage. Link to comment Share on other sites More sharing options...
swh Posted August 21, 2015 Share Posted August 21, 2015 I managed to solve that problem - I think it should be reported as bug. I overwrote one line of FrontControler->addColorsToProductList FROM $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])); TO $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl'); so it is as it was in version 1.6.0.9 and it works Link to comment Share on other sites More sharing options...
anconstantinescu Posted September 24, 2015 Share Posted September 24, 2015 (edited) I confirm that the changes + cache refresh does the trick. However, the problem surfaces again in a few hours. LE: It seems the problem is somehow related to the client cache. Once the browser cache is emptied, the problem dissapears, only to come back again in a short time. I managed to solve that problem - I think it should be reported as bug. I overwrote one line of FrontControler->addColorsToProductList FROM $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])); TO $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl'); so it is as it was in version 1.6.0.9 and it works Edited September 25, 2015 by anconstantinescu (see edit history) Link to comment Share on other sites More sharing options...
onpelikan Posted December 13, 2015 Share Posted December 13, 2015 Hi, I have the same proglem. When I cleare cache the notice is gone but after some hours it is back again. Link to comment Share on other sites More sharing options...
rossella21 Posted August 3, 2016 Share Posted August 3, 2016 Anyone solved that problem? Link to comment Share on other sites More sharing options...
kdmonk1 Posted September 30, 2016 Share Posted September 30, 2016 (edited) Hi Team, I believe this may be the fix for this issue. http://stackoverflow.com/questions/39408532/how-to-resolve-the-prestashop-notice Open /themes/YOUR_THEME/product-list-colors.tpl Search for {foreach from=$colors_list item='color'} and add a condition that will check if the '$colors_list' variable is set or not. The final code will be something like as follows: {if isset($colors_list)}//Current foreach loop code{/if} Lastly, don't forget to clear your cache! Edited September 30, 2016 by kdmonk1 (see edit history) Link to comment Share on other sites More sharing options...
onpelikan Posted January 29, 2018 Share Posted January 29, 2018 (edited) Pretty old topic but I still have the problem. Version 1.6.1.17. I hoped it is resolved after the update. Edited January 29, 2018 by onpelikan typo (see edit history) 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