ProductPageLoadedEvent example

if (!Feature::isActive('v6.6.0.0')) {
            $this->loadDefaultAdditions($product$page$request$context);
        } elseif ($cmsPage = $product->getCmsPage()) {
            $page->setCmsPage($cmsPage);
        }

        $this->loadOptions($page);
        $this->loadMetaData($page);

        $this->eventDispatcher->dispatch(
            new ProductPageLoadedEvent($page$context$request)
        );

        return $page;
    }

    private function loadOptions(ProductPage $page): void
    {
        $options = new PropertyGroupOptionCollection();

        if (($optionIds = $page->getProduct()->getOptionIds()) === null) {
            $page->setSelectedOptions($options);

            
Home | Imprint | This part of the site doesn't use cookies.