49. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2021-05-13 09:08:39 +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.

49.1 Files compared

#LocationFileLast Modified
1/Applications/Ampps/www/Porto 3.2.2/Theme Files/Magento 2.x/Porto Theme/app/code/Mageplaza/Search/view/frontend/templatessearch.phtml2017-12-05 00:57:18 +0000
2/Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/code/Mageplaza/Search/view/frontend/templatessearch.phtml2021-01-06 00:29:00 +0000

49.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged2250
Changed12
Inserted00
Removed00

49.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

49.4 Active regular expressions

No regular expressions were active.

49.5 Comparison detail

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_Search 17  * @package     Mageplaza_Search
18  * @copyright   Copyright (c) 2017 Mageplaza (http://www.mageplaza.com/) 18  * @copyright   Copyright (c) 2017 Mageplaza (http://www.mageplaza.com/)
19  * @license     https://www.mageplaza.com/LICENSE.txt 19  * @license     https://www.mageplaza.com/LICENSE.txt
20  */ 20  */
21 // @codingStandardsIgnoreFile 21 // @codingStandardsIgnoreFile
22 ?> 22 ?>
23 <?php 23 <?php
24 /** @var $block \Magento\Framework\View\Element\Template */ 24 /** @var $block \Magento\Framework\View\Element\Template */
25  25 
26 /** @var $helper \Mageplaza\Search\Helper\Data */ 26 /** @var $helper \Mageplaza\Search\Helper\Data */
27 $helper = $this->helper('Mageplaza\Search\Helper\Data'); 27 $helper = $this->helper('Mageplaza\Search\Helper\Data');
28 if ($helper->isEnabled()): 28 if ($helper->isEnabled()):
29     /** @var \Magento\Search\Helper\Data $searchHelper */ 29     /** @var \Magento\Search\Helper\Data $searchHelper */
30     $searchHelper = $this->helper(\Magento\Search\Helper\Data::class); 30     $searchHelper = $this->helper(\Magento\Search\Helper\Data::class);
31     ?> 31     ?>
32     <?php if ($helper->getConfigGeneral('category/enable')): ?> 32     <?php if ($helper->getConfigGeneral('category/enable')): ?>
33     <div class="search-category" style="position:absolute; top: 0; right: 35px; width: 130px"> 33     <div class="search-category" style="position:absolute; top: 0; right: 40px; width: 130px">
34         <select id="mpsearch-category"> 34         <select id="mpsearch-category">
35             <?php foreach ($helper->getCategoryTree() as $id => $name): ?> 35             <?php foreach ($helper->getCategoryTree() as $id => $name): ?>
36                 <option value="<?php echo $id ?>"><?php echo $name ?></option> 36                 <option value="<?php echo $id ?>"><?php echo $name ?></option>
37             <?php endforeach; ?> 37             <?php endforeach; ?>
38         </select> 38         </select>
39     </div> 39     </div>
40     <?php endif; ?> 40     <?php endif; ?>
41     <script src="<?php echo $helper->getJsFileUrl(); ?>"></script> 41     <script src="<?php echo $helper->getJsFileUrl(); ?>"></script>
42     <script type="text/javascript"> 42     <script type="text/javascript">
43     require([ 43     require([
44         'jquery', 44         'jquery',
45         'Magento_Catalog/js/price-utils', 45         'Magento_Catalog/js/price-utils',
46         'mpDevbridgeAutocomplete' 46         'mpDevbridgeAutocomplete'
47     ], function ($, priceUtils) { 47     ], function ($, priceUtils) {
48         "use strict"; 48         "use strict";
49  49 
50         var baseUrl = '<?php echo trim($block->getBaseUrl(), '/') . '/' ?>', 50         var baseUrl = '<?php echo trim($block->getBaseUrl(), '/') . '/' ?>',
51             baseImageUrl = '<?php echo $helper->getMediaHelper()->getSearchMediaUrl() ?>', 51             baseImageUrl = '<?php echo $helper->getMediaHelper()->getSearchMediaUrl() ?>',
52             priceFormat = <?php echo $helper->getPriceFormat() ?>, 52             priceFormat = <?php echo $helper->getPriceFormat() ?>,
53             displayInfo = <?php echo $helper->getDisplay() ?>; 53             displayInfo = <?php echo $helper->getDisplay() ?>;
54  54 
55         var categorySelect = $('#mpsearch-category'), 55         var categorySelect = $('#mpsearch-category'),
56             searchInput = $('#search'); 56             searchInput = $('#search');
57         if (categorySelect.length) { 57         if (categorySelect.length) {
58             categorySelect.on('change', function () { 58             categorySelect.on('change', function () {
59                 searchInput.focus(); 59                 searchInput.focus();
60  60 
61                 if ($(this).val() === 0) { 61                 if ($(this).val() === 0) {
62                     $(this).removeAttr('name'); 62                     $(this).removeAttr('name');
63                 } else { 63                 } else {
64                     $(this).attr('name', 'cat'); 64                     $(this).attr('name', 'cat');
65                 } 65                 }
66             }); 66             });
67         } 67         }
68  68 
69         searchInput.devbridgeAutocomplete({ 69         searchInput.devbridgeAutocomplete({
70             lookup: mageplazaSearchProducts, 70             lookup: mageplazaSearchProducts,
71             lookupLimit: <?php  echo (int)$helper->getConfigGeneral('max_query_results') ?: 10; ?>, 71             lookupLimit: <?php  echo (int)$helper->getConfigGeneral('max_query_results') ?: 10; ?>,
72             maxHeight: 2000, 72             maxHeight: 2000,
73             minChars: <?php echo $searchHelper->getMinQueryLength(); ?>, 73             minChars: <?php echo $searchHelper->getMinQueryLength(); ?>,
74             lookupFilter: function (suggestion, query, queryLowerCase) { 74             lookupFilter: function (suggestion, query, queryLowerCase) {
75                 if (categorySelect.length) { 75                 if (categorySelect.length) {
76                     var categoryId = categorySelect.val(); 76                     var categoryId = categorySelect.val();
77                     if (categoryId > 0 && ($.inArray(categoryId, suggestion.c) === -1)) { 77                     if (categoryId > 0 && ($.inArray(categoryId, suggestion.c) === -1)) {
78                         return false; 78                         return false;
79                     } 79                     }
80                 } 80                 }
81  81 
82                 return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1; 82                 return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
83             }, 83             },
84             onSelect: function (suggestion) { 84             onSelect: function (suggestion) {
85                 window.location.href = correctProductUrl(suggestion.u); 85                 window.location.href = correctProductUrl(suggestion.u);
86             }, 86             },
87             formatResult: function (suggestion, currentValue) { 87             formatResult: function (suggestion, currentValue) {
88                 var html = '<a href="' + correctProductUrl(suggestion.u) + '">'; 88                 var html = '<a href="' + correctProductUrl(suggestion.u) + '">';
89  89 
90                 if ($.inArray('image', displayInfo) !== -1) { 90                 if ($.inArray('image', displayInfo) !== -1) {
91                     html += '<div class="suggestion-left"><img class="img-responsive" src="' + correctProductUrl(suggestion.i, true) + '" alt="" /></div>'; 91                     html += '<div class="suggestion-left"><img class="img-responsive" src="' + correctProductUrl(suggestion.i, true) + '" alt="" /></div>';
92                 } 92                 }
93  93 
94                 html += '<div class="suggestion-right">'; 94                 html += '<div class="suggestion-right">';
95                 html += '<div class="product-line product-name">' + suggestion.value + '</div>'; 95                 html += '<div class="product-line product-name">' + suggestion.value + '</div>';
96  96 
97                 if ($.inArray('price', displayInfo) !== -1) { 97                 if ($.inArray('price', displayInfo) !== -1) {
98                     html += '<div class="product-line product-price"><?php echo __('Price: ') ?>' + priceUtils.formatPrice(suggestion.p, priceFormat) + '</div>'; 98                     html += '<div class="product-line product-price"><?php echo __('Price: ') ?>' + priceUtils.formatPrice(suggestion.p, priceFormat) + '</div>';
99                 } 99                 }
100  100 
101                 if ($.inArray('description', displayInfo) !== -1 && suggestion.d) { 101                 if ($.inArray('description', displayInfo) !== -1 && suggestion.d) {
102                     html += '<div class="product-des"><p class="short-des">' + suggestion.d + '...</p></div>'; 102                     html += '<div class="product-des"><p class="short-des">' + suggestion.d + '...</p></div>';
103                 } 103                 }
104  104 
105                 html += '</div></a>'; 105                 html += '</div></a>';
106  106 
107                 return html; 107                 return html;
108             } 108             }
109     //» »       onSearchComplete: function (query, suggestion) { 109     //» »       onSearchComplete: function (query, suggestion) {
110     //» »       »       $('.autocomplete-suggestions').append("<div id='view_all'><a href='javascript:void(0)' id='search-view-all'>View all >></a></div>"); 110     //» »       »       $('.autocomplete-suggestions').append("<div id='view_all'><a href='javascript:void(0)' id='search-view-all'>View all >></a></div>");
111     //» »       »       $('#search-view-all').on('click', function(){ 111     //» »       »       $('#search-view-all').on('click', function(){
112     //» »       »          $('#search_mini_form').submit(); 112     //» »       »          $('#search_mini_form').submit();
113     //            }); 113     //            });
114     //» »       } 114     //» »       }
115         }); 115         });
116  116 
117         function correctProductUrl(urlKey, isImage) { 117         function correctProductUrl(urlKey, isImage) {
118             if (urlKey.search('http') !== -1) { 118             if (urlKey.search('http') !== -1) {
119                 return urlKey; 119                 return urlKey;
120             } 120             }
121  121 
122             return ((typeof isImage !== 'undefined') ? baseImageUrl : baseUrl) + urlKey; 122             return ((typeof isImage !== 'undefined') ? baseImageUrl : baseUrl) + urlKey;
123         } 123         }
124     }); 124     });
125     </script> 125     </script>
126 <?php endif; ?> 126 <?php endif; ?>