Jump to content

Shuffle/splice of ActiveRecordIterator


Go to solution Solved by Daniel F,

Recommended Posts

I am using this code in several feed block templates to show a random entry from a selection of entries:

{{shuffle($records);}}
{{$records = array_slice($records, 0, 1);}}

But it doesn’t work for Commerce feed blocks, as $packages is not an array. Anyone knows how to adopt the above code to work with these ActiveRecordIterators?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...