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.
Displaying Product Manufacturer Information
You can assign a manufacturer to each product in your catalog. The manufacturer PHP object (Shop_Manufacturer) is accessible through the $manufacturer field of the Shop_Product class (the $product variable). To keep the product page code clean, it is recommended to create a separate partial for displaying products manufacturer information. The following code outputs all manufacturer details.
<? if ($product->manufacturer): ?>
<h4>Manufacturer</h4>
<p>
<?= h($product->manufacturer->name) ?>
</p>
<?= $product->manufacturer->description ?>
<img src="<?= h($product->manufacturer->logo_url(100, 'auto')) ?>"/>
<p>Address: <?= h($product->manufacturer->address) ?><br/>
City: <?= h($product->manufacturer->city) ?><br/>
ZIP: <?= h($product->manufacturer->zip) ?><br/>
Phone: <?= h($product->manufacturer->phone) ?><br/>
Fax: <?= h($product->manufacturer->fax) ?><br/>
Country: <?= h($product->manufacturer->columnValue('country')) ?><br/>
State: <?= h($product->manufacturer->columnValue('state')) ?><br/>
Email: <?= h($product->manufacturer->email) ?><br/>
Website: <?= h($product->manufacturer->url) ?>
</p>
<? endif ?>
{% set manufacturer = field(product, 'manufacturer') %}
{% if manufacturer %}
<h4>Manufacturer</h4>
<p>
{{ manufacturer.name }}
</p>
{{ manufacturer.description|unescape }}
<img src="{{ manufacturer.logo_url(100, 'auto') }}"/>
<p>Address: {{ manufacturer.address }}<br/>
City: {{ manufacturer.city }}<br/>
ZIP: {{ manufacturer.zip }}<br/>
Phone: {{ manufacturer.phone }}<br/>
Fax: {{ manufacturer.fax }}<br/>
Country: {{ manufacturer.columnValue('country') }}<br/>
State: {{ manufacturer.columnValue('state') }}<br/>
Email: {{ manufacturer.email }}<br/>
Website: {{ manufacturer.url }}
</p>
{% endif %}Now you can render the partial on the product page. Note that we named the manufacturer partial shop:manufacturer, but of course you can use any name.
Next: Displaying Product Bundle Items
Previous: Displaying a List of Related Products
Return to Displaying a List of Products
