Skip to main content
2 of 2
Added code for the case where function returns a collection
user2045
  • 831
  • 3
  • 16
  • 29

Well you could try to change the php for loop to be

<?php $i=0; foreach(array_reverse($this->getGalleryImages()) as $_image): ?>

or

<?php $i=0; foreach(array_reverse($this->getGalleryImages()->getData()) as $_image): ?>

if getGalleryImages() returns a collection

but that would be kind of a hack. That may meet your immediate needs however. In general, you should post the code for getGalleryImages() so we can see if the problem lies there or in possibly in your DB.

user2045
  • 831
  • 3
  • 16
  • 29