File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,18 @@ public function getEnabled(): bool
9595
9696 /* check if Plumrocket AMP enabled */
9797 if ($ this ->enabled ) {
98- $ isAmpRequest = $ this ->getConfig (self ::XML_PATH_AMP_ENABLED );
99- if ($ isAmpRequest ) {
100- /* We know that using objectManager is not a not a good practice,
98+ /* We know that using objectManager is not a not a good practice,
10199 but if Plumrocket_AMP is not installed on your magento instance
102100 you'll get error during di:compile */
103- $ objectManager = \Magento \Framework \App \ObjectManager::getInstance ();
101+ $ objectManager = \Magento \Framework \App \ObjectManager::getInstance ();
102+
103+ $ isAmpRequest = $ this ->getConfig (self ::XML_PATH_AMP_ENABLED );
104+ if ($ isAmpRequest ) {
104105 $ isAmpRequest = $ objectManager ->get ('\Plumrocket\Amp\Helper\Data ' )
105106 ->isAmpRequest ();
107+ } else {
108+ $ isAmpRequest = $ objectManager ->get (\Magento \Framework \App \RequestInterface::class)
109+ ->getParam ('is_amp ' );
106110 }
107111 $ this ->enabled = !$ isAmpRequest ;
108112 }
You can’t perform that action at this time.
0 commit comments