Invalid argument supplied for foreach … toolbar.phtml
This article show how to fix the follow Magento Error for Magento 1.4.0.1 :
"There has been an error processing your request
Exception printing is disabled by default for security reasons."
"Invalid argument supplied for foreach … toolbar.phtml "
magento error description
In magento product list page , when select the "Show per page" items , got the error
"There has been an error processing your request
Exception printing is disabled by default for security reasons."
, when this happens , just go to the root/errors
change the local.xml.sample to local.xml .
Refresh the page again , the error become
"Invalid argument supplied for foreach … toolbar.phtml " .
How to fix it
Open app/design/frontend/default/yourtheme/layout/catalog.xml ,add follow line
<block type="page/html_pager" name="product_list_toolbar_pager" template="page/html/pager.phtml" />after each
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> </block>
then change each
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
to
<action method="setToolbarBlockName"><name>product_list_toolbar_pager</name></action>
After all of this done , just refresh the page , thank god ! It’s work !
Notice
Please make sure disabled all cache when you start work . I also head of some people meet this problem when install magento 1.4 , hope this can help to fix this too but didn’t test . Happy reading !
Update
After post this article , i got same error on shop by brand page , after try many times test , i find a another way : open /public_html/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
if you see
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template
just change it to
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Page_Block_Html_Pager
then update the file . Refresh the page then it work .Hope this can help you !!! Happy reading !!!
Donate
if you find it usefull for you and like it very much , please make a
to help me to write more articles .
Thanks very much.
, I'm a freelancer and available now,if need help just contact me without hesitation.
61 Responses to “Invalid argument supplied for foreach … toolbar.phtml”
Leave a Reply
-
Search for:
Categories
- apache (2)
- css xhtml (10)
- html5 (1)
- javascript (3)
- jquery (5)
- magento (3)
- mysql (1)
- php (1)
- SEO Friendly (6)
- Tools (3)
- w3c validation (4)
- Wordpress (4)


















I hit this issue myself and your fix worked like a charm. Thanks.
It works greate with your updated part !! Thanks.
adjusting toolbar.php file worked! thnx!
Idem dito. The Toolbar.php does the trick. Thanks!
I tried both your methods – the first fixed the error but badly affected the design – for some reason it spoiled the layout of the catalogue summary pages.
Adjusting the toolbar.php however to extend the alternative class worked perfectly and has had no side-effects.
I noticed that this problem was also affecting my site-search – and again the change to toolbar.php has fixed the problem.
Thank you very much for putting this page up – it has saved me an enormous headache. Many thanks.
yes the best way is adjusting the toolbar.php .the fist methods only can remove the error but the second one is real fix for this error.
Method one worked but then displayed my products in list instead of grid view (even if I set it to grid in the back end).
Number 2 fixed it perfectly.
You’ve just saved tons of my time! thanks
2nd worked like a charm, very quick and solved what I thought would be another big Magento headache A***** Thanks
The 2nd option worked an absolute treat
)
My name is Piter Jankovich. oOnly want to tell, that your blog is really cool
And want to ask you: is this blog your hobby?
P.S. Sorry for my bad english
Thanx,
Worked perfectly on magento 1.4.0.1
half for hobby half for money.as a freelancer i can get projects form my site.
thanks alot, good job. it absolutely fixed my problem!
Magento 1.4.0.1
Great site. A lot of useful information here. I’m sending it to some friends!
You actually saved my life
Thank you so much for your work here. This piece brought my site back to life.
Roger
yep
The solution can help.
It worked.
Thank so much.
Cool blog!!
I actually had to edit the catalog.xml as the Toolbar.php file did not need to be changed.
One category on the site was returning the error “There has been an error processing your request Exception printing is disabled by default for security reasons.”
“There has been an error processing your request Exception printing is disabled by default for security reasons.”
this is general error,you need change the local.xml.sample to local.xml . to view the details error
this is only for details error
“Invalid argument supplied for foreach … toolbar.phtml ” .
Good share,you article very great, very usefull for us…thank you
Thanks for this
information
Really nice and impressive blog i found today.
Thank you for sharing I wish I could go somwhere.
Many thanks !
Thank you for sharing the solution.
You’re a life saver!
TnX!!!
good share, great article, very usefull for us…thanks!
Nice brief and this post helped me alot in my college assignement. Thank you for your information.
Great and perfect. Appreciate your contribution.
My cousin recommended this blog and she was totally right keep up the fantastic work!
worked for me!
Thanks!
That’s great.. but if you search product there is the same error.. toolbar.phtml…
I think we can apply your modify to other files.. but wich one file?
Thanks in advance
Ops. it’s work fine…
i forgot to make 2nd help.
Thanks alot!!!
Perfect!
Thanks!
nice one – thanks a lot …
worked perfectly.
after using the fix i cant see anything, just white screen, i am using the latest magento version, can you help me please.
Thanks
How is it possible? Why magento team didn’t create a patch for this?
BTW, Toolbar.php patch did the job
you maybe do something wrong,did you try the method 2?
Worked like a charm!
Thank You
Its worked like a magic with one line. (2nd meth)
Thanks,
Riti
Great site. A lot of useful information here. I’m sending it to some friends!
thanks alot dnt know wot id do widout u guys,
Genial brief and this enter helped me alot in my college assignement. Gratefulness you seeking your information.
hi, your site really great help, want to ask something after i did both step, my product remain in list i want to make it in grid, i try to set the backend in grid but still nothing change, please advice…
thanks a lot!
please only use the update part,your site may have other problem,you cant make it show in grid is not caused by this fix.
Genial post and this fill someone in on helped me alot in my college assignement. Gratefulness you for your information.
Worked with one exception, the products display in “list” mode vs. “grid” mode. I have the admin setup to only display “grid” mode in the catalog. Is there anyway to fix this?
Greatly appreciated.
Thanks,
Mike
did u use the update section fix? that have no effect to other function,in fact the update section fix is codes supposed to be upload,it caused by a small fault of magento team. but they explain structure in the development,that’s where i find the fix way.