Documentation

For developpers

To use this useful attribute into your design or theme, you can display attribute display by the code :

<?php
$ak = CoreCommerceProductAttributeKey::getByHandle('related_products');
$related = $product->getAttributeValueObject($ak);
$related->getValue('imageLinks');
?>

Custom view

YOu can also create custom view that you can personalize. Add a folder named 'display' into root/element and copy/paste it one of these files placed into package/mylab_related_product/element/display. Rename it 'custom1.php'. You can create 3 different custom views, just name it custom1, custom2 or custom3

Call this view as mentionned above with the name of custom view as parameter of the getValue call :

<?php
$ak = CoreCommerceProductAttributeKey::getByHandle('related_products');
$related = $product->getAttributeValueObject($ak);
$related->getValue('custom1');
?>