The generateProduct
hook is called when the product page (reader) is rendered. It allows to add custom information to the product page.
\Isotope\Template $template
The template object.
\Isotope\Interfaces\IsotopeProduct $product
The product model.
// src/EventListener/Isotope/GenerateProductListener.php
namespace App\EventListener\Isotope;
use Isotope\Model\Product\AbstractProduct;
use Isotope\ServiceAnnotation\IsotopeHook;
use Isotope\Template;
/**
* @IsotopeHook("generateProduct")
*/
class GenerateProductListener
{
public function __invoke(Template $template, IsotopeProduct $product): void
{
$template->customMessage = 'We currently have more orders than usual. Please expect longer waiting times.';
}
}