New Zenner
- Join Date:
- May 2014
- Location:
- Planet Earth
- Posts:
- 18
- Plugin Contributions:
- 0
Display Current Category Image in Custom Menu
Hello!
I am working on a new menu for my as yet unpublished site and I am customizing a new categories_ul_generator.php that I have modified based on code I believe (I've been working on it for a while now) I acquired from one of Picaflor-Azul's menus.
I am working with ZenCart v151 and am working locally with XAMPP. I am currently using the stock Zen Cart Template.
Everything works correctly. However, I need to pull the current category image so that it displays in the category link.
$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * 1) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
// The following code in BLUE is what I would like to replicate as it does exactly what I need:
// $result .= '<img src="images/image.jpg" alt="image"/><span>" "</span>';
// where <img src="current categories_image"/>
// The following code in RED is what I need corrected.
$result .= '<img src="php code that calls current categories_image"';
$result .='" alt="';
$result .= 'php code that calls current categories_image alt name';
$result .='"/><span>';
$result .= $category['name'];
$result .= '</span>';
$result .= '</a>';
I've tried various methods to insert the proper code but I am obviously doing it wrong. I'm not even sure I need the alt code as I've seen snippets that calls the category image along with it's height and width etc and div's that echo the appropriate call to categories path and image info but I cannot find a way to assign anything with echo (so I replaced it with print which doesn't work in the manner I would desire) to a $result so that it displays in the correct order or at all.
Thank you for any assistance!