diff --git a/Plugin/OverrideProductImageTemplate.php b/Plugin/OverrideProductImageTemplate.php deleted file mode 100644 index c30c0bc..0000000 --- a/Plugin/OverrideProductImageTemplate.php +++ /dev/null @@ -1,31 +0,0 @@ -config = $config; - } - - public function beforeSetTemplate(ImageSubject $subject, string $template): array - { - if ($this->config->isProductImageLazyloadingEnabled()) { - // Set template to Fisheye_Lazyload - $template = str_replace('Magento_Catalog', 'Fisheye_Lazyload', $template); - } - return [$template]; - } -} diff --git a/README.md b/README.md index 2808a23..72b1516 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ A Magento 2 module that adds support for lazy loading of images. ## Compatibility -* Magento Community Edition / Enterprise Edition 2.2.x, 2.3.x, 2.4.x (see older releases for 2.0 / 2.1 support) +* Magento Community Edition / Enterprise Edition 2.4.x (see older releases for 2.0 - 2.3 support) * Supports Magento 2 Full Page Cache (including Varnish) ## Installation diff --git a/Scope/Config.php b/Scope/Config.php index 700d041..8d3d6fa 100644 --- a/Scope/Config.php +++ b/Scope/Config.php @@ -11,7 +11,6 @@ class Config { /** Stores configuration paths */ - const XML_PATH_CATALOG_PRODUCT_IMAGE_LAZYLOAD_ENABLED = 'catalog/product_image_lazyload/enabled'; const XML_PATH_CATALOG_IMAGE_PRELOAD_ENABLED = 'catalog/product_image_lazyload/preload'; /** @@ -24,18 +23,10 @@ public function __construct(ScopeConfigInterface $scopeConfig) $this->scopeConfig = $scopeConfig; } - public function isProductImageLazyloadingEnabled(): bool - { - return $this->scopeConfig->isSetFlag( - self::XML_PATH_CATALOG_PRODUCT_IMAGE_LAZYLOAD_ENABLED, - ScopeInterface::SCOPE_STORE - ); - } - public function isImagePreloadingEnabled(): bool { return $this->scopeConfig->isSetFlag( - self::XML_PATH_CATALOG_PRODUCT_IMAGE_LAZYLOAD_ENABLED, + self::XML_PATH_CATALOG_IMAGE_PRELOAD_ENABLED, ScopeInterface::SCOPE_STORE ); } diff --git a/composer.json b/composer.json index c03df11..3b2dfe6 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "fisheye/module-lazyload", - "type": "magento2-module", "description": "A Magento 2 module that adds support for lazy loading of images.", "license": "MIT", + "type": "magento2-module", "authors": [ { "name": "Fisheye Media Ltd.", @@ -14,7 +14,7 @@ } ], "require": { - "magento/module-catalog": "^102.0 || ^103.0 || ^104.0" + "magento/module-catalog": "^104.0" }, "autoload": { "psr-4": { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 578b9cf..ba6d411 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -16,17 +16,6 @@ showInWebsite="1" showInStore="1"> - - Magento\Config\Model\Config\Source\Yesno - - - 1 1 diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml deleted file mode 100644 index f8acaec..0000000 --- a/etc/frontend/di.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/etc/module.xml b/etc/module.xml index 4ca8ab6..7975485 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -6,8 +6,8 @@ */ --> - + xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml index 2565bdb..8a2fe17 100644 --- a/view/frontend/layout/default.xml +++ b/view/frontend/layout/default.xml @@ -16,7 +16,7 @@ header .lazyload diff --git a/view/frontend/layout/hyva_default.xml b/view/frontend/layout/hyva_default.xml new file mode 100644 index 0000000..99849f9 --- /dev/null +++ b/view/frontend/layout/hyva_default.xml @@ -0,0 +1,22 @@ + + + + + +