174. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-03-13 03:01:03 +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.

174.1 Files compared

#LocationFileLast Modified
12023-03-13 03:01:03 +0000
2Porto v4.0.5/Porto Theme/app/code/Smartwave/Porto/PluginPortoRemoveBlock.php2023-03-08 01:02:37 +0000

174.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged00
Changed00
Inserted142
Removed00

174.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

174.4 Active regular expressions

No regular expressions were active.

174.5 Comparison detail

    1 <?php
    2 
    3 namespace Smartwave\Porto\Plugin;
    4 
    5 use Magento\Framework\Event\Observer;
    6 use Magento\Framework\Event\ObserverInterface;
    7 use Magento\Framework\App\Config\ScopeConfigInterface;
    8 use Magento\Store\Model\ScopeInterface;
    9 
    10 class PortoRemoveBlock implements ObserverInterface
    11 {
    12   protected $_scopeConfig;
    13 
    14   public function __construct
    15   (
    16       ScopeConfigInterface $scopeConfig
    17   )
    18   {
    19       $this->_scopeConfig = $scopeConfig;
    20   }
    21 
    22   public function execute(Observer $observer)
    23   {
    24     /** @var \Magento\Framework\View\Layout $layout */
    25     $layout = $observer->getLayout();
    26     $blockSidebarMenu = $layout->getBlock('sidebar.menu');
    27     $blockRelated = $layout->getBlock('catalog.product.related');
    28     if ($blockRelated) {
    29       $removeRelated = $this->_scopeConfig->getValue('porto_settings/product/move_related', ScopeInterface::SCOPE_STORE);
    30       if ($removeRelated) {
    31         $layout->unsetElement('catalog.product.related');
    32       }
    33     }
    34     if($blockSidebarMenu) {
    35       $header = $this->_scopeConfig->getValue('porto_settings/header/header_type', ScopeInterface::SCOPE_STORE);
    36       $leftmenu_enable = $this->_scopeConfig->getValue('porto_settings/header/leftmenu_enable', ScopeInterface::SCOPE_STORE);
    37       if($header != '25' || $leftmenu_enable == '0'){
    38         $layout->unsetElement('sidebar.menu');
    39       }
    40     }
    41   }
    42 }