<?php

use NP\Factory as NpFactory;

$data = array(
    'product' => $this->product,
    'related_products' => array(),
);

if (!empty($this->product->customfieldsSorted['related_products'])) {
    $data['related_products'] = $this->product->customfieldsSorted['related_products'];
}
$page = NpFactory::getTemplate('product');
$page->setTemplateData($data);
$page->buildPageElements();
echo $page->getHtml();
