Produced by Araxis Merge on 2020-08-14 00:01:30 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v3.2.3/Magento 2.x/Porto Theme/app/code/Mageplaza/LayeredNavigation/Helper | Data.php | 2018-10-10 20:33:20 +0000 |
| 2 | Porto v3.2.4/Magento 2.x/Porto Theme/app/code/Mageplaza/LayeredNavigation/Helper | Data.php | 2020-06-26 11:11:14 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 11 | 144 |
| Changed | 6 | 12 |
| Inserted | 3 | 36 |
| Removed | 1 | 10 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | /** | 2 | /** | |||
| 3 | * Mageplaza | 3 | * Mageplaza | |||
| 4 | * | 4 | * | |||
| 5 | * NOTICE OF LICENSE | 5 | * NOTICE OF LICENSE | |||
| 6 | * | 6 | * | |||
| 7 | * This source file is subject to the Mageplaza.com license that is | 7 | * This source file is subject to the Mageplaza.com license that is | |||
| 8 | * available through the world-wide-web at this URL: | 8 | * available through the world-wide-web at this URL: | |||
| 9 | * https://www.mageplaza.com/LICENSE.txt | 9 | * https://www.mageplaza.com/LICENSE.txt | |||
| 10 | * | 10 | * | |||
| 11 | * DISCLAIMER | 11 | * DISCLAIMER | |||
| 12 | * | 12 | * | |||
| 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer | 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer | |||
| 14 | * version in the future. | 14 | * version in the future. | |||
| 15 | * | 15 | * | |||
| 16 | * @category Mageplaza | 16 | * @category Mageplaza | |||
| 17 | * @package Mageplaza_LayeredNavigation | 17 | * @package Mageplaza_LayeredNavigation | |||
| 18 | * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | 18 | * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | |||
| 19 | * @license https://www.mageplaza.com/LICENSE.txt | 19 | * @license https://www.mageplaza.com/LICENSE.txt | |||
| 20 | */ | 20 | */ | |||
| 21 | 21 | |||||
| 22 | namespace Mageplaza\LayeredNavigation\Helper; | 22 | namespace Mageplaza\LayeredNavigation\Helper; | |||
| 23 | 23 | |||||
| 24 | use Magento\Catalog\Model\Layer\Filter\FilterInterface; | |||||
| 25 | use Magento\Customer\Model\Session; | |||||
| 26 | use Magento\Framework\DataObject; | |||||
| 27 | use Magento\Framework\Exception\LocalizedException; | |||||
| 28 | use Magento\Framework\ObjectManagerInterface; | |||||
| 29 | use Magento\Store\Model\Store; | |||||
| 30 | use Mageplaza\LayeredNavigation\Model\Layer\Filter; | |||||
| 31 | ||||||
| 24 | /** | 32 | /** | |||
| 25 | * Class Data | 33 | * Class Data | |||
| 26 | * @package Mageplaza\LayeredNavigation\Helper | 34 | * @package Mageplaza\LayeredNavigation\Helper | |||
| 27 | */ | 35 | */ | |||
| 28 | class Data extends \Mageplaza\AjaxLayer\Helper\Data | 36 | class Data extends \Mageplaza\AjaxLayer\Helper\Data | |||
| 29 | { | 37 | { | |||
| 30 | const FILTER_TYPE_SLIDER = 'slider'; | 38 | const FILTER_TYPE_SLIDER = 'slider'; | |||
| 31 | const FILTER_TYPE_LIST = 'list'; | 39 | const FILTER_TYPE_LIST = 'list'; | |||
| 32 | 40 | |||||
| 33 | /** @var \Mageplaza\LayeredNavigation\Model\Layer\Filter */ | 41 | /** @var Filter */ | |||
| 34 | protected $filterModel; | 42 | protected $filterModel; | |||
| 35 | 43 | |||||
| 36 | /** | 44 | /** | |||
| 37 | * @param null $storeId | |||||
| 38 | * | |||||
| 39 | * @return mixed | |||||
| 40 | */ | |||||
| 41 | public function isEnabled($storeId = null) | |||||
| 42 | { | |||||
| 43 | return $this->getConfigGeneral('enable', $storeId) && $this->isModuleOutputEnabled(); | |||||
| 44 | } | |||||
| 45 | ||||||
| 46 | /** | |||||
| 47 | * @param $filters | 45 | * @param $filters | |||
| 46 | * | |||||
| 48 | * @return mixed | 47 | * @return mixed | |||
| 49 | */ | 48 | */ | |||
| 50 | public function getLayerConfiguration($filters) | 49 | public function getLayerConfiguration($filters) | |||
| 51 | { | 50 | { | |||
| 52 | $filterParams = $this->_getRequest()->getParams(); | 51 | $filterParams = $this->_getRequest()->getParams(); | |||
| 53 | foreach ($filterParams as $key => $param) { | 52 | foreach ($filterParams as $key => $param) { | |||
| 54 | $filterParams[$key] = htmlspecialchars($param); | 53 | $filterParams[$key] = htmlspecialchars($param); | |||
| 55 | } | 54 | } | |||
| 56 | 55 | |||||
| 57 | $config = new \Magento\Framework\DataObject([ | 56 | $config = new | |||
| 58 | 'active' => array_keys($filterParams), | 57 | 'active' => array_keys($filterParams), | |||
| 59 | 'params' => $filterParams, | 58 | 'params' => $filterParams, | |||
| 60 | 'isCustomerLoggedIn' => $this->objectManager->create('Magento\Customer\Model\Session')->isLoggedIn(), | 59 | 'isCustomerLoggedIn' => $this->objectManager->create( | |||
| 61 | 'isAjax' => $this->ajaxEnabled() | 60 | 'isAjax' => $this->ajaxEnabled() | |||
| 62 | ]); | 61 | ]); | |||
| 63 | 62 | |||||
| 64 | $this->getFilterModel()->getLayerConfiguration($filters, $config); | 63 | $this->getFilterModel()->getLayerConfiguration($filters, $config); | |||
| 65 | 64 | |||||
| 66 | return self::jsonEncode($config->getData()); | 65 | return self::jsonEncode($config->getData()); | |||
| 67 | } | 66 | } | |||
| 68 | 67 | |||||
| 69 | /** | 68 | /** | |||
| 70 | * @return \Mageplaza\LayeredNavigation\Model\Layer\Filter | 69 | * @return Filter | |||
| 71 | */ | 70 | */ | |||
| 72 | public function getFilterModel() | 71 | public function getFilterModel() | |||
| 73 | { | 72 | { | |||
| 74 | if (!$this->filterModel) { | 73 | if (!$this->filterModel) { | |||
| 75 | $this->filterModel = $this->objectManager->create('Mageplaza\LayeredNavigation\Model\Layer\Filter'); | 74 | $this->filterModel = $this->objectManager->create( | |||
| 76 | } | 75 | } | |||
| 77 | 76 | |||||
| 78 | return $this->filterModel; | 77 | return $this->filterModel; | |||
| 79 | } | 78 | } | |||
| 80 | 79 | |||||
| 81 | /** | 80 | /** | |||
| 82 | * @return \Magento\Framework\ObjectManagerInterface | 81 | * @return | |||
| 83 | */ | 82 | */ | |||
| 84 | public function getObjectManager() | 83 | public function getObjectManager() | |||
| 85 | { | 84 | { | |||
| 86 | return $this->objectManager; | 85 | return $this->objectManager; | |||
| 87 | } | 86 | } | |||
| 87 | ||||||
| 88 | /** | |||||
| 89 | * @param FilterInterface $filter | |||||
| 90 | * @param null $storeId | |||||
| 91 | * | |||||
| 92 | * @return string | |||||
| 93 | */ | |||||
| 94 | public function getTooltipContent($filter, $storeId = null) | |||||
| 95 | { | |||||
| 96 | try { | |||||
| 97 | $store = $this->storeManager->getStore($storeId); | |||||
| 98 | $labels = $filter->getAttributeModel()->getData('tooltip_content'); | |||||
| 99 | if (isset($labels[$store->getId()])) { | |||||
| 100 | if (empty($labels[$store->getId()])) { | |||||
| 101 | return $labels[Store::DEFAULT_STORE_ID]; | |||||
| 102 | } | |||||
| 103 | ||||||
| 104 | return $labels[$store->getId()]; | |||||
| 105 | } | |||||
| 106 | ||||||
| 107 | return ''; | |||||
| 108 | } catch (LocalizedException $e) { | |||||
| 109 | $this->_logger->error($e); | |||||
| 110 | ||||||
| 111 | return ''; | |||||
| 112 | } | |||||
| 113 | } | |||||
| 88 | } | 114 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.