Get all product images, including excluded images

前端 未结 3 922
灰色年华
灰色年华 2021-02-11 04:19

I\'ve been using getMediaGalleryImages, but I just realized that doesn\'t return excluded images. Is there another similar method that does?

相关标签:
3条回答
  • 2021-02-11 04:37

    A bit late, but others may want to try

    $product->getMediaGallery('images')
    

    for getting all images in an array, including the ones marked with 'exclude'.

    0 讨论(0)
  • 2021-02-11 04:44
    $product = $this->getProduct();
    $galleryData = $product->getData('media_gallery');
    

    Something like above code will get all Media images for a product.

    0 讨论(0)
  • If You use custom collection try to add this:

    ->addAttributeToSelect('*')
    
    0 讨论(0)
提交回复
热议问题