Hi,
I've created a mega menu for my website. I've also added an image to the "menu thumbnail" input.
So this is where the file is located : http://mywebsite.com/img/tmp/category_13-0_thumb.jpg?time=1585727749
I'm overriding the ps_mainmenu.php file in order to add some data to my item menu.
I'm trying to get the image thanks to this, but it's always returning an empty array :
$files = scandir(_PS_TMP_IMG_DIR_); // $files = scandir(_PS_CAT_IMG_DIR_); if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) { foreach ($files as $file) { if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) { $image_url = $this->context->link->getMediaLink(_THEME_CAT_DIR_.$file); $thumbnail[] = $image_url; } } }
I'm working on PS 1.7.