2

I'm trying to show data in sale_order table. I follow this guide: enter link description here

And I got the error is: enter image description here

My files are: enter image description here

And: enter image description here Can anyone help?? Thanks!

  • 1
    try to change the loop like foreach($collection as $coll) then change all the names in the loop like $collection->getTitile() to $coll->getTitile() Inshallah it will work for you – Asad Khan Jun 27 at 10:52
  • Thank you @Asad Khan. I tried but it still doesn't work. Anything else I was wrong in my code? – Michael Tao Jun 28 at 1:32
2

Change Your foreach arguments,

foreach($collection as $col) {
       /*Your logic*/
}
1

You are not suppose to use the same parameter name in your foreach, try to use other variable name like $data or $item:

<?php foreach ($collection as $data): ?>
        <tr>
            ...
            <td data-th="Title" class="col title"><?php echo $data->getTitle(); ?></td>                
            ...
       </tr>
<?php endforeach; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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