This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

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 a List of Related Products

Displaying related products is a simple task, if you have followed our advice to create a separate partial for displaying a product list.

You can obtain a collection of related products with the list_related_products() method of the $product object. The following code demonstrates how you can output a list of related products using the partial you created before.

The code checks whether any related products were assigned to the current products and outputs the header “Related products”. Then it renders the shop:product_list partial passing a result of the list_related_products() method call as a collection of products into the product list partial.

You can duplicate the shop:product_list partial and modify it if you need another way of displaying the related products.

See also:

Next: Displaying Product Manufacturer Information
Previous: Displaying Extra Product Options
Return to Displaying a List of Products