LemonStand Version 1 Has Been Discontinued
This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.
Manufacturer List page
To create a page displaying a list of all manufacturers, you should use the shop:manufacturers action. This action creates the $manufacturers PHP variable, which is a collection of manufacturers. Each element in the collection is an instance of the Shop_Manufacturer class.
Start with creating a new page and assign it some name and URL. On the Actions page select the shop:manufacturers action. For the page code you can use the following content:
<ul> <? foreach ($manufacturers as $manufacturer): ?> <li> <a href="/manufacturer/<?= $manufacturer->url_name ?>"><?= h($manufacturer->name) ?></a> </li> <? endforeach ?> </ul>
<ul> {% for manufacturer in manufacturers %} <li> <a href="/manufacturer/{{ manufacturer.url_name }}">{{ manufacturer.name }}</a> </li> {% endfor %} </ul>
Please note that the code creates a link for each manufacturer. The link refers to a page with the /manufacturer URL. On this page you can display manufacturer details and a list of manufacturer products. As any page in LemonStand the manufacturer details page URL is not fixed. In the example we used the /manufacturer URL, but you can use any other URL.
The process of creating a manufacturer details page is described in the next article.
Next: Manufacturer Details page
Previous: Implementing the Compare Products feature
Return to Advanced Features for your Online Store