2

Does anyone know how to get the image with a specific role from a product. For example, I've created a new role called 'global' and assigned one of the product images to that role. How can I get that image ?

Thanks

1 Answer 1

3

For getting custom product image role at any place using product object like below way,

You can just get product image role using below way,

$_products->getData('global');

If product with global role is assigned at that time you got global image value in above query.

Clear cache and check.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.