VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on June 03, 2022, 09:33:12 AM

Title: [SOLVED] Get Category images?
Post by: EvanGR on June 03, 2022, 09:33:12 AM
Hello,

I am trying to get the images for a category in a custom module I am working on.

I can get the category by doing:
$categoryModel->getCategory($catId);

However I don't see the images for the category.

I am interested in getting the filenames so I can use them in my code (instead of the built-in displayMediaThumb method)

Thanks
Title: Re: Get Category images?
Post by: GJC Web Design on June 03, 2022, 10:39:59 AM
$category = $categoryModel->getCategory($catId);
$categoryModel->addImages($category);

does that work?
Title: Re: Get Category images?
Post by: EvanGR on June 03, 2022, 11:34:56 AM
Yes, thank you very much!