Storefront not working.

I am following this video https://academy.shopware.com/courses/take/shopware-6-developer-training-english/lessons/9225170-data-storefront

 

According the this video, before creating any twig file http://localhost:8000/ should render page without footer. But I have been following every steps and in my case it renders everything.

Please refer to my FooterSubscriber.php page:

 

class FooterSubscriber implements EventSubscriberInterface { /** * @var SystemConfigService */ private $systemConfigService; /** * @var EntityRepositoryInterface */ private $shopFinderRepository; /** * FooterSubscriber constructor. * @param SystemConfigService $systemConfigService * @param EntityRepositoryInterface $shopFinderRepository */ public function __construct(SystemConfigService $systemConfigService, EntityRepositoryInterface $shopFinderRepository) { $this->systemConfigService = $systemConfigService; $this->shopFinderRepository = $shopFinderRepository; } public static function getSubscribedEvents(): array { return [FooterPageletLoadedEvent::class => ‚onFooterPageLoaded‘]; } public function onFooterPageLoaded(FooterPageletLoadedEvent $event): void { if (!$this->systemConfigService->get(‚Storefront.config.showInStoreFront‘)) { return; } $shops = $this->fetchShops($event->getContext()); $event->getPagelet()->addExtension(‚swag_shop_finder‘, $shops); } /** * @param Context $context * @return ShopFinderCollection */ private function fetchShops(Context $context): ShopFinderCollection { $criteria = new Criteria(); $criteria->addAssociation(‚country‘); $criteria->addFilter(new EqualsFilter(‚active‘, 1)); $criteria->setLimit(5); /** * @var ShopFinderCollection $shopFinderCollection */ $shopFinderCollection = $this->shopFinderRepository->search($criteria, $context); return $shopFinderCollection; } }

 

config.xml

 

<?xml version="1.0" encoding="UTF-8"?> Basic configuration German Title showInStorefront Show in storefront Zeige in storefront

Late answer for anyone who has the same problem:

Activate your plugin / theme / app, before testing. Otherwise you will see the footer rendered by the active default theme.

This can be done in the store admin in the browser. Go to „My Extensions“ and find your extension (probably in the „Themes“ tab, depending on your Shopware 6 version). If it is not installed yet, click the link „Install app“ (or probably install plugin / theme, again depending on SW 6 version), and once it has been installed, click the on/off-switch icon to activate.

Another late answer.

The path where the twig file has to be stored changed.

In the video views/layout/footer/footer.html.twig was created.

It have to be views/storefront/layout/footer/footer.hmtl.twig right now. (v6.4.16.1)

1 „Gefällt mir“

There have been several changes since 6.0, so copying the code from the original Academy videos will not work. There are newer videos on YouTube, linked from the respective Shopware documentation articles.
I have listed some deprecations and changes in a blog post as well:
Shopware 6 changes since the academy training videos