Skip to main content
Added code for the case where function returns a collection
Source Link
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.

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

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

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.

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.

Source Link
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): ?>

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.