trustpilot / plugin-magento2

Magento 2 plugin for sending invitation data to Trustpilot
MIT License
10 stars 27 forks source link

magento 2.4 index page #97

Open crodar33 opened 2 years ago

crodar33 commented 2 years ago

Hi trustpilot module version 2.6.564 Had issue with check index page, in this place, on index page, I got cms_page_view instead of cms_index_index if ($this->_request->getFullActionName() == 'cms_index_index') { temporary solved it by:

--- a/Block/Trustbox.php
+++ b/Block/Trustbox.php
@@ -65,7 +65,8 @@
                     $trustboxSettings->categoryProductsData = $this->loadCategoryProductInfo($scope, $storeId, $currentCategory);
                 }
             }
-            if ($this->_request->getFullActionName() == 'cms_index_index') {
+            #if ($this->_request->getFullActionName() == 'cms_index_index') {
+            if (in_array('cms_index_index', $this->getLayout()->getUpdate()->getHandles())) {
                 $loadedTrustboxes = array_merge((array)$this->loadPageTrustboxes($settings, 'landing'), (array)$loadedTrustboxes);
             }