Skip to content

Commit 327011a

Browse files
committed
Fix for amasty amp
1 parent 9a7bf68 commit 327011a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Model/Config.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)