Step 1). Create the Vendor/Module/etc/frontend/event.xml in your module
1 2 3 |
<event name="controller_action_postdispatch"> <observer name="change_title_filter" instance="Vendor\Module\Observer\Filtertitle" /> </event> |
Step 2). Create the Vendor/Module/Observer/Filtertitle.php in your module
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<?php namespace Vendor\Module\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Event\Observer; use Magento\Framework\View\LayoutInterface; class Filtertitle implements ObserverInterface { protected $context; public function __construct( \Magento\Framework\View\Element\Template $context, \Magento\Framework\View\Result\Page $resultPage, \Magento\Framework\View\Page\Config $pageConfig ) { $this->pageConfig = $pageConfig; $this->resultPageFactory = $resultPage; $this->context = $context; } public function execute(\Magento\Framework\Event\Observer $observer) { $layout = $this->context->getLayout(); $pageMainTitle = $layout->getBlock('page.main.title'); if ($pageMainTitle) { $blockfilter = $layout->getBlock('catalog.navigation.state'); if($blockfilter){ $selectedFilters = $blockfilter->getActiveFilters(); if (!empty($selectedFilters)){ $filters = array(); foreach($selectedFilters as $filter){ $filters[] = $blockfilter->stripTags($filter->getLabel()); } if(count($filters) > 0){ $activefilters = __("Your selection: ").implode(" - ", $filters); $pageMainTitle->setPageTitle($activefilters); } } } } } } |
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62845bd96a313400588093/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...