categoryImage
function, since version 1.2.3
categories: image, category, prestashop
categoryImage(categoryId, name, [type])
returns url to category image. Function respects prestashop Friendly URL settings.
parameters
- categoryId: number - id of category
- name: string - if Friendly URL is enabled, this will be the output name of image file. If Friendly URL is disabled, this parameter is ignored.
- type number - id of image type. Please see
Preferences > Images
in your prestashop back office for list of IDs
return type:
string
example
categoryImage(category.id, category.friendlyUrl) // https://www.domain.com/img/c/3.jpg