I am trying to give a customer the ability to subscribe to several categories of newsletters.
I am making a webshop for a sportstore and I want the customer to be able to choose between newsletters with subjects:
- General Subscription
In the file app\design\frontend\default\default\template\customer\form\newsletter.phtml I want to place a checkbox for every existing store in my Magento database.
I tried to add the following code at line 27:
<?php foreach ($this->getStores() as $_store)
echo $_store->getName() ;
The above code is for test purposal to try and enumerate all the store names.
I get the following error:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\magento_1_1_0\app\design\frontend\default\default\template\customer\form\newsletter.phtml on line 28
Can someone explain me why this doesn’t work in newsletter.phtml and why it does work in app\code\core\Mage\Page\Block\Switch.php for example?
Thanks in advance