dizzi Posted November 28, 2013 Share Posted November 28, 2013 Hi all, I want to add a category image to the category menu. I'm using CC4 and right now the code is <ul class="ul-nav"> <!-- END: ul_start --> <!-- BEGIN: li_start --> <li class="li-nav"> <!-- END: li_start --> <a href="index.php?_a=viewCat&catId={DATA.cat_id}">{DATA.cat_name}</a> <!-- BEGIN: li_end --> </li> <!-- END: li_end --> <!-- BEGIN: ul_end --> </ul> and I want to place the small image here <a href="index.php?_a=viewCat&catId={DATA.cat_id}">{DATA.cat_name}IMAGE TO GO HERE</a> <!-- BEGIN: li_end --> Can anyone direct me on how to "call" the category image. I'm assuming its something like this <a href="index.php?_a=viewCat&catId={DATA.cat_id}">{DATA.cat_name}<img src="CODE THAT CALLS THE RELEVANT CAT IMAGE"</a> <!-- BEGIN: li_end --> Hope this makes sense. Cheers. Miles Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 28, 2013 Share Posted November 28, 2013 Hi Miles, This isn't hugely straightforward.. You need to edit the function "getCategoryTree" in the classes/catalog.class.php file. 1. The select query on the CubeCart_category needs to pull out the cat_image number. 2. The foreach loop needs to take this ID and add key to the $results array with the image path using the function "imagePath" from classes/catalogue.class.php 3. Then add the macro to the HTML template as you have above. Quote Link to comment Share on other sites More sharing options...
dizzi Posted November 28, 2013 Author Share Posted November 28, 2013 Hi Al, thank you for the feedback. Do you know the equivalent file in CC version 4? I couldn't find classes/catalog.class.php in CC4, only in CC5. Regards. Miles Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 29, 2013 Share Posted November 29, 2013 I'm sorry but I haven't looked at v4 in a long time and I am rusty. You should upgrade to v5. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 30, 2013 Share Posted November 30, 2013 Since this forum is dedicated to v5, you might want to ask on cubecartforums.org for this and future questions. They have a v4 section there. Quote Link to comment Share on other sites More sharing options...
dizzi Posted November 30, 2013 Author Share Posted November 30, 2013 Hi Al, not to worry, thanks anyway. I know, I should upgrade to new CC. Will look at it after Xmas so I don't mess with current sales. Regards. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted December 2, 2013 Share Posted December 2, 2013 Thanks Miles, please let us know if you have any questions about the v5 upgrade in the meantime. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.