95. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2022-11-18 03:12:09 +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.

95.1 Files compared

#LocationFileLast Modified
1Porto Theme/app/design/frontend/Smartwave/porto/Smartwave_Filterproducts/templatesmasonry_grid.phtml2022-04-30 08:31:20 +0000
2Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/Smartwave_Filterproducts/templatesmasonry_grid.phtml2022-11-02 08:52:04 +0000

95.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged4768
Changed213
Inserted00
Removed11

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

95.4 Active regular expressions

No regular expressions were active.

95.5 Comparison detail

1 <?php 1 <?php
2 /** 2 /**
3  * Copyright © 2015 Magento. All rights reserved. 3  * Copyright © 2015 Magento. All rights reserved.
4  * See COPYING.txt for license details. 4  * See COPYING.txt for license details.
5  */ 5  */
6 use Magento\Framework\App\Action\Action; 6 use Magento\Framework\App\Action\Action;
7  7 
8 // @codingStandardsIgnoreFile 8 // @codingStandardsIgnoreFile
9 ?> 9 ?>
10 <?php 10 <?php
11 /** 11 /**
12  * Product list template 12  * Product list template
13  * 13  *
14  * @var $block \Smartwave\Filterproducts\Block\ 14  * @var $block \Smartwave\Filterproducts\Block\
15  */ 15  */
16 ?> 16 ?>
17 <?php 17 <?php
18 $_productCollection = $block->getLoadedProductCollection(); 18 $_productCollection = $block->getLoadedProductCollection();
19 $_helper = $this->helper('Magento\Catalog\Helper\Output'); 19 $_helper = $this->helper('Magento\Catalog\Helper\Output');
20 $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); 20 $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
21 $_portohelper = $this->helper('Smartwave\Porto\Helper\Data'); 21 $_portohelper = $this->helper('Smartwave\Porto\Helper\Data');
22 $review_model = $_portohelper->getModel('\Magento\Review\Model\Review'); 22 $review_model = $_portohelper->getModel('\Magento\Review\Model\Review');
23 $_category_config = $_portohelper->getConfig('porto_settings/category'); 23 $_category_config = $_portohelper->getConfig('porto_settings/category');
24 $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid'); 24 $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid');
25 $_product_label_config = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/product_label'); 25 $_product_label_config = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/product_label');
26  26 
27 $aspect_ratio = $this->getData("aspect_ratio"); 27 $aspect_ratio = $this->getData("aspect_ratio");
28 if($aspect_ratio == null) { 28 if($aspect_ratio == null) {
29     $aspect_ratio = $_category_config['aspect_ratio']; 29     $aspect_ratio = $_category_config['aspect_ratio'];
30 } 30 }
31 $image_width = $this->getData("image_width"); 31 $image_width = $this->getData("image_width");
32 if(!$image_width) { 32 if(!$image_width) {
33     $image_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300; 33     $image_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300;
34 } 34 }
35 $image_height = $this->getData("image_height"); 35 $image_height = $this->getData("image_height");
36 if($aspect_ratio) 36 if($aspect_ratio)
37     $image_height = $image_width; 37     $image_height = $image_width;
38 if(!$image_height) { 38 if(!$image_height) {
39     $image_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300; 39     $image_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300;
40 } 40 }
41 $masonry_layout = $this->getData("masonry_layout"); 41 $masonry_layout = $this->getData("masonry_layout");
42 if($masonry_layout == null) { 42 if($masonry_layout == null) {
43     $masonry_layout = '1'; 43     $masonry_layout = '1';
44 } 44 }
45 $product_type = $this->getData("product_type"); 45 $product_type = $this->getData("product_type");
46 if($product_type == null) { 46 if($product_type == null) {
47     $product_type = 1; 47     $product_type = 1;
48 } 48 }
49 $masonry_id = $this->getData("name"); 49 $masonry_id = $this->getData("name");
50 if($masonry_id == null) { 50 if($masonry_id == null) {
51     $masonry_id = "masonry_1"; 51     $masonry_id = "masonry_1";
52 } 52 }
53 if($product_type == 1) { 53 if($product_type == 1) {
54     $product_type = 7; 54     $product_type = 7;
55 }else if($product_type == 2) { 55 }else if($product_type == 2) {
56     $product_type = 8; 56     $product_type = 8;
57 }else if($product_type == 3) { 57 }else if($product_type == 3) {
58     $product_type = 11; 58     $product_type = 11;
59 } 59 }
60 $gap_width = $this->getData("gap_width"); 60 $gap_width = $this->getData("gap_width");
61 if($gap_width == null) { 61 if($gap_width == null) {
62     $gap_width = 0; 62     $gap_width = 0;
63 } 63 }
64 $gap_width = $gap_width / 2; 64 $gap_width = $gap_width / 2;
65  65 
66 $grid_height = $this->getData("grid_height"); 66 $grid_height = $this->getData("grid_height");
67 if($grid_height == null) { 67 if($grid_height == null) {
68     $grid_height = 600; 68     $grid_height = 600;
69 } 69 }
70 $product_grid_layout_arr = array(); 70 $product_grid_layout_arr = array();
71 if ( '1' == $masonry_layout ) { 71 if ( '1' == $masonry_layout ) {
72     $product_grid_layout_arr = array( 72     $product_grid_layout_arr = array(
73         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ), 73         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ),
74         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 74         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
75         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ), 75         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
76         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 76         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
77     ); 77     );
78 } 78 }
79 if ( '2' == $masonry_layout ) { 79 if ( '2' == $masonry_layout ) {
80     $product_grid_layout_arr = array( 80     $product_grid_layout_arr = array(
81         array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1' ), 81         array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1' ),
82         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 82         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
83         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ), 83         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
84         array( 'height' => '1-3', 'width' => '1-2', 'width_md' => '1' ), 84         array( 'height' => '1-3', 'width' => '1-2', 'width_md' => '1' ),
85         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 85         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
86     ); 86     );
87 } 87 }
88 if ( '3' == $masonry_layout ) { 88 if ( '3' == $masonry_layout ) {
89     $product_grid_layout_arr = array( 89     $product_grid_layout_arr = array(
90         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ), 90         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ),
91         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ), 91         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
92         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 92         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
93         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 93         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
94     ); 94     );
95 } 95 }
96 if ( '4' == $masonry_layout ) { 96 if ( '4' == $masonry_layout ) {
97     $product_grid_layout_arr = array( 97     $product_grid_layout_arr = array(
98         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ), 98         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ),
99         array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ), 99         array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ),
100         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ), 100         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ),
101         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ), 101         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ),
102         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ), 102         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ),
103         array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ), 103         array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ),
104     ); 104     );
105 } 105 }
106 if ( '5' == $masonry_layout ) { 106 if ( '5' == $masonry_layout ) {
107     $product_grid_layout_arr = array( 107     $product_grid_layout_arr = array(
108         array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '1-2' ), 108         array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '1-2' ),
109         array( 'height' => '1', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 109         array( 'height' => '1', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
110         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 110         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
111         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 111         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
112         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 112         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
113         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 113         array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
114     ); 114     );
115 } 115 }
116 if ( '6' == $masonry_layout ) { 116 if ( '6' == $masonry_layout ) {
117     $product_grid_layout_arr = array( 117     $product_grid_layout_arr = array(
118         array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1', 'width_lg' => '1-2' ), 118         array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1', 'width_lg' => '1-2' ),
119         array( 'height' => '2-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ), 119         array( 'height' => '2-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
120         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ), 120         array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
121         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ), 121         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
122         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ), 122         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
123         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ), 123         array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
124     ); 124     );
125 } 125 }
126 if ( '7' == $masonry_layout ) { 126 if ( '7' == $masonry_layout ) {
127     $product_grid_layout_arr = array( 127     $product_grid_layout_arr = array(
128         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ), 128         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ),
129         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ), 129         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
130         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 130         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
131         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 131         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
132         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 132         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
133         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ), 133         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
134         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ), 134         array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
135         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ), 135         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
136         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ), 136         array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ),
137         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ), 137         array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
138     ); 138     );
139 } 139 }
140 if ( '8' == $masonry_layout ) { 140 if ( '8' == $masonry_layout ) {
141     $product_grid_layout_arr = array( 141     $product_grid_layout_arr = array(
142         array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ), 142         array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
143         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 143         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
144         array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ), 144         array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
145         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 145         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
146         array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ), 146         array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ),
147         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 147         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
148         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 148         array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
149         array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ), 149         array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ),
150     ); 150     );
151 } 151 }
152 if ( '9' == $masonry_layout ) { 152 if ( '9' == $masonry_layout ) {
153     $product_grid_layout_arr = array( 153     $product_grid_layout_arr = array(
154         array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '2-3' ), 154         array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '2-3' ),
155         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ), 155         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ),
156         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ), 156         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ),
157         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 157         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
158         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 158         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
159         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 159         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
160         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ), 160         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
161     ); 161     );
162 } 162 }
163 if ( '10' == $masonry_layout ) { 163 if ( '10' == $masonry_layout ) {
164     $product_grid_layout_arr = array( 164     $product_grid_layout_arr = array(
165         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '2-3', 'width_md' => '1' ), 165         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '2-3', 'width_md' => '1' ),
166         array( 'height' => '1', 'height_md' => '1', 'width' => '1-3', 'width_md' => '1-2' ), 166         array( 'height' => '1', 'height_md' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
167         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 167         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
168         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ), 168         array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
169     ); 169     );
170 } 170 }
171 $product_limit = count($product_grid_layout_arr); 171 $product_limit = count($product_grid_layout_arr);
172 ?> 172 ?>
173 <?php if (!$_productCollection->count()): ?> 173 <?php if (!$_productCollection->count()): ?>
174     <div class="message info empty"><div><?php echo __('We can\'t find products matching the selection.') ?></div></div> 174     <div class="message info empty"><div><?php echo __('We can\'t find products matching the selection.') ?></div></div>
175 <?php else: ?> 175 <?php else: ?>
176     <?php 176     <?php
177     $viewMode = 'grid'; 177     $viewMode = 'grid';
178     $image = 'category_page_grid'; 178     $image = 'category_page_grid';
179     $hover_image = 'category_page_grid-hover'; 179     $hover_image = 'category_page_grid-hover';
180     $showDescription = false; 180     $showDescription = false;
181     $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW; 181     $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
182     ?> 182     ?>
183     <div id="<?php echo $masonry_id; ?>" class="wrapper <?php echo $viewMode; ?> products-<?php echo $viewMode; ?> masonry-grid"> 183     <div id="<?php echo $masonry_id; ?>" class="wrapper <?php echo $viewMode; ?> products-<?php echo $viewMode; ?> masonry-grid">
184         <?php $iterator = 1; ?> 184         <?php $iterator = 1; ?>
185         <div class="filterproducts products list items product-items"> 185         <div class="filterproducts products list items product-items">
186             <?php /** @var $_product \Magento\Catalog\Model\Product */ ?> 186             <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
187             <?php foreach ($_productCollection as $_product): ?> 187             <?php foreach ($_productCollection as $_product): ?>
188                 <?php if($product_limit >= $iterator): ?> 188                 <?php if($product_limit >= $iterator): ?>
189                 <?php echo($iterator++ == 1) ? '<div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' : '</div><div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' ?> 189                 <?php echo($iterator++ == 1) ? '<div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' : '</div><div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' ?>
190                 <div class="product-item-info type<?php echo $product_type; ?>" data-container="product-grid"> 190                 <div class="product-item-info type<?php echo $product_type; ?>" data-container="product-grid">
191                     <?php // Product Image ?> 191                     <?php // Product Image ?>
192                     <div class="product photo product-item-photo"> 192                     <div class="product photo product-item-photo">
193                         <a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1"> 193                         <a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1">
194                         <?php 194                         <?php
195                             if($aspect_ratio) 195                             if($aspect_ratio)
196                                 $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width); 196                                 $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
197                             else 197                             else
198                                 $productImage = $_imagehelper->init($_product, $image)->resize($image_width, $image_height); 198                                 $productImage = $_imagehelper->init($_product, $image)->resize($image_width, $image_height);
199                             $productImageUrl = $productImage->getUrl(); 199                             $productImageUrl = $productImage->getUrl();
200                         ?> 200                         ?>
201                             <img class="product-image-photo default_image" src="<?php echo $productImageUrl; ?>" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" alt="<?php //echo $productImage->getLabel();?>"/> 201                             <img class="product-image-photo default_image" src="<?php echo $productImageUrl; ?>" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" alt="<?php //echo $productImage->getLabel();?>"/>
202                         <?php if($_category_config['alternative_image']): ?> 202                         <?php if($_category_config['alternative_image']): ?>
203                         <?php 203                         <?php
204                             if($aspect_ratio) 204                             if($aspect_ratio)
205                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width); 205                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
206                             else 206                             else
207                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->resize($image_width, $image_height); 207                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->resize($image_width, $image_height);
208                             $productHoverImageUrl = $productHoverImage->getUrl(); 208                             $productHoverImageUrl = $productHoverImage->getUrl();
209                         ?> 209                         ?>
210                             <?php if($productImageUrl != str_replace("/thumbnail/","/small_image/",$productHoverImageUrl)): ?> 210                             <?php if($productImageUrl != str_replace("/thumbnail/","/small_image/",$productHoverImageUrl)): ?>
211                             <img class="product-image-photo hover_image" src="<?php echo $productHoverImageUrl; ?>" alt="<?php //echo $productHoverImage->getLabel();?>"/> 211                             <img class="product-image-photo hover_image" src="<?php echo $productHoverImageUrl; ?>" alt="<?php //echo $productHoverImage->getLabel();?>"/>
212                             <?php endif; ?> 212                             <?php endif; ?>
213                         <?php endif; ?> 213                         <?php endif; ?>
214                         </a> 214                         </a>
215                         <?php 215                         <?php
216                             $product_label = ""; 216                             $product_label = "";
217                             if($_product_label_config['sale_label']) { 217                             if($_product_label_config['sale_label']) {
218                                 $orgprice = $_product->getPrice(); 218                                 if ($percentage = $_portohelper->getPercentage($_product)) {
219                                 $specialprice = $_product->getSpecialPrice();    
220                                 $specialfromdate = $_product->getSpecialFromDate();    
221                                 $specialtodate = $_product->getSpecialToDate();    
222                                 $today = time();    
223                                 if(!$specialprice)    
224                                     $specialprice = $orgprice;    
225                                 if($specialprice < $orgprice) {    
226                                     if((is_null($specialfromdate) && is_null($specialtodate)) || ($today >= strtotime($specialfromdate) && is_null($specialtodate)) || ($today <= strtotime($specialtodate) && is_null($specialfromdate)) || ($today >= strtotime($specialfromdate) && $today <= strtotime($specialtodate))){    
227                                         if($_product_label_config['sale_label_percent']) { 219                                     if($_product_label_config['sale_label_percent']) {
228                                             $save_percent = 100-round(($specialprice/$orgprice)*100); 220                                         $product_label .= '<div class="product-label sale-label">'.
$percentage.'%'.'</div>';
229                                             $product_label .= '<div class="product-label sale-label">'.'-'.$save_percent.'%'.'</div>';    
230                                         } else { 221                                     } else {
231                                             $product_label .= '<div class="product-label sale-label">'.$_product_label_config['sale_label_text'].'</div>'; 222                                         $product_label .= '<div class="product-label sale-label">'.$_product_label_config['sale_label_text'].'</div>';
232                                         } 223                                     }
233                                     } 224                                 }
234                                 } 225                             }
235                             }    
236                             if($_product_label_config['new_label']) { 226                             if($_product_label_config['new_label']) {
237                                 $now = date("Y-m-d"); 227                                 $now = date("Y-m-d");
238                                 $newsFrom= substr($_product->getData('news_from_date')?$_product->getData('news_from_date'):'',0,10); 228                                 $newsFrom= substr($_product->getData('news_from_date')?$_product->getData('news_from_date'):'',0,10);
239                                 $newsTo=  substr($_product->getData('news_to_date')?$_product->getData('news_to_date'):'',0,10); 229                                 $newsTo=  substr($_product->getData('news_to_date')?$_product->getData('news_to_date'):'',0,10);
240  230 
241                                 if ($newsTo != '' || $newsFrom != ''){ 231                                 if ($newsTo != '' || $newsFrom != ''){
242                                     if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) { 232                                     if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) {
243                                         $product_label .= '<div class="product-label new-label">'.$_product_label_config['new_label_text'].'</div>'; 233                                         $product_label .= '<div class="product-label new-label">'.$_product_label_config['new_label_text'].'</div>';
244                                     } 234                                     }
245                                 } 235                                 }
246                             } 236                             }
247                             if($product_label) 237                             if($product_label)
248                                 echo '<div class="product-labels">'.$product_label.'</div>'; 238                                 echo '<div class="product-labels">'.$product_label.'</div>';
249                         ?> 239                         ?>
250                         <div class="product-item-inner"> 240                         <div class="product-item-inner">
251                             <div class="product actions product-item-actions"> 241                             <div class="product actions product-item-actions">
252                                 <div class="actions-primary"> 242                                 <div class="actions-primary">
253                                     <?php if ($_product->isSaleable()): ?> 243                                     <?php if ($_product->isSaleable()): ?>
254                                         <?php $postParams = $block->getAddToCartPostParams($_product); ?> 244                                         <?php $postParams = $block->getAddToCartPostParams($_product); ?>
255                                         <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post"> 245                                         <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post">
256                                             <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>"> 246                                             <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>">
257                                             <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>"> 247                                             <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
258  248 
259                                             <?php echo $block->getBlockHtml('formkey')?> 249                                             <?php echo $block->getBlockHtml('formkey')?>
260                                             <button type="submit" 250                                             <button type="submit"
261                                                     title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>" 251                                                     title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
262                                                     class="action tocart primary"> 252                                                     class="action tocart primary">
263                                                 <span><?php echo __('Add to Cart') ?></span> 253                                                 <span><?php echo __('Add to Cart') ?></span>
264                                             </button> 254                                             </button>
265                                         </form> 255                                         </form>
266                                     <?php else: ?> 256                                     <?php else: ?>
267                                         <?php if ($_product->getIsSalable()): ?> 257                                         <?php if ($_product->getIsSalable()): ?>
268                                             <div class="stock available"><span><?php echo __('In stock') ?></span></div> 258                                             <div class="stock available"><span><?php echo __('In stock') ?></span></div>
269                                         <?php else: ?> 259                                         <?php else: ?>
270                                             <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div> 260                                             <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div>
271                                         <?php endif; ?> 261                                         <?php endif; ?>
272                                     <?php endif; ?> 262                                     <?php endif; ?>
273                                 </div> 263                                 </div>
274                                 <?php if ($block->getMode() == 'grid'): ?> 264                                 <?php if ($block->getMode() == 'grid'): ?>
275                                 <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?> 265                                 <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?>
276                                     <a href="#" 266                                     <a href="#"
277                                        class="action towishlist actions-secondary" 267                                        class="action towishlist actions-secondary"
278                                        title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" 268                                        title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
279                                        aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>" 269                                        aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
280                                        data-post='<?php echo $block->getAddToWishlistParams($_product); ?>' 270                                        data-post='<?php echo $block->getAddToWishlistParams($_product); ?>'
281                                        data-action="add-to-wishlist" 271                                        data-action="add-to-wishlist"
282                                        role="button"> 272                                        role="button">
283                                         <span><?php echo __('Add to Wish List') ?></span> 273                                         <span><?php echo __('Add to Wish List') ?></span>
284                                     </a> 274                                     </a>
285                                 <?php endif; ?> 275                                 <?php endif; ?>
286                                 <?php endif; ?> 276                                 <?php endif; ?>
287                                 <?php if($_category_config['addtocompare']): ?> 277                                 <?php if($_category_config['addtocompare']): ?>
288                                 <?php 278                                 <?php
289                                 $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); 279                                 $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
290                                 ?> 280                                 ?>
291                                 <a href="#" 281                                 <a href="#"
292                                    class="action tocompare actions-secondary" 282                                    class="action tocompare actions-secondary"
293                                    title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" 283                                    title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
294                                    aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>" 284                                    aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
295                                    data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>' 285                                    data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>'
296                                    role="button"> 286                                    role="button">
297                                     <span><?php echo __('Add to Compare') ?></span> 287                                     <span><?php echo __('Add to Compare') ?></span>
298                                 </a> 288                                 </a>
299                                 <?php endif; ?> 289                                 <?php endif; ?>
300                             </div> 290                             </div>
301                         </div> 291                         </div>
302                     </div> 292                     </div>
303                     <div class="product details product-item-details"> 293                     <div class="product details product-item-details">
304                         <?php 294                         <?php
305                             $_productNameStripped = $block->stripTags($_product->getName(), null, true); 295                             $_productNameStripped = $block->stripTags($_product->getName(), null, true);
306                         ?> 296                         ?>
307                         <strong class="product name product-item-name"> 297                         <strong class="product name product-item-name">
308                             <a class="product-item-link" 298                             <a class="product-item-link"
309                                href="<?php echo $_product->getProductUrl() ?>"> 299                                href="<?php echo $_product->getProductUrl() ?>">
310                                 <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?> 300                                 <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
311                             </a> 301                             </a>
312                         </strong> 302                         </strong>
313                         <?php //$_category_config['rating_star'] = "";  //disabled at the moment ?> 303                         <?php //$_category_config['rating_star'] = "";  //disabled at the moment ?>
314                         <?php if($_category_config['rating_star']): ?> 304                         <?php if($_category_config['rating_star']): ?>
315                         <?php 305                         <?php
316                             $review_model->getEntitySummary($_product); 306                             $review_model->getEntitySummary($_product);
317                             $review_html = $block->getReviewsSummaryHtml($_product, $templateType); 307                             $review_html = $block->getReviewsSummaryHtml($_product, $templateType);
318                         ?> 308                         ?>
319                         <?php if($review_html): ?> 309                         <?php if($review_html): ?>
320                             <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?> 310                             <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?>
321                         <?php else: ?> 311                         <?php else: ?>
322                         <div class="product-reviews-summary short"> 312                         <div class="product-reviews-summary short">
323                             <div class="rating-summary"> 313                             <div class="rating-summary">
324                                 <span class="label"><span>Rating:</span></span> 314                                 <span class="label"><span>Rating:</span></span>
325                                 <div class="rating-result" title="0%"> 315                                 <div class="rating-result" title="0%">
326                                     <span style="width:0"><span>0%</span></span> 316                                     <span style="width:0"><span>0%</span></span>
327                                 </div> 317                                 </div>
328                             </div> 318                             </div>
329                         </div> 319                         </div>
330                         <?php endif; ?> 320                         <?php endif; ?>
331                         <?php endif; ?> 321                         <?php endif; ?>
332                         <?php if($_category_config['product_price']): ?> 322                         <?php if($_category_config['product_price']): ?>
333                         <?php echo $block->getProductPrice($_product) ?> 323                         <?php echo $block->getProductPrice($_product) ?>
334                         <?php endif; ?> 324                         <?php endif; ?>
335                         <?php echo $block->getProductDetailsHtml($_product); ?> 325                         <?php echo $block->getProductDetailsHtml($_product); ?>
336                     </div> 326                     </div>
337                 </div> 327                 </div>
338                 <?php echo($iterator == count($_productCollection)+1 || $product_limit+1 == $iterator) ? '</div>' : '' ?> 328                 <?php echo($iterator == count($_productCollection)+1 || $product_limit+1 == $iterator) ? '</div>' : '' ?>
339                 <?php endif; ?> 329                 <?php endif; ?>
340             <?php endforeach; ?> 330             <?php endforeach; ?>
341         </div> 331         </div>
342         <style> 332         <style>
343             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts { 333             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts {
344                 margin: -<?php echo $gap_width; ?>px; 334                 margin: -<?php echo $gap_width; ?>px;
345             } 335             }
346             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item { 336             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item {
347                 padding: <?php echo $gap_width; ?>px; 337                 padding: <?php echo $gap_width; ?>px;
348                 margin-bottom: 0; 338                 margin-bottom: 0;
349             } 339             }
350             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1 { 340             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1 {
351                 height: <?php echo $grid_height; ?>px; 341                 height: <?php echo $grid_height; ?>px;
352             } 342             }
353             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-2 { 343             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-2 {
354                 height: <?php echo $grid_height / 2 ?>px; 344                 height: <?php echo $grid_height / 2 ?>px;
355             } 345             }
356             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-3 { 346             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-3 {
357                 height: <?php echo $grid_height / 3; ?>px; 347                 height: <?php echo $grid_height / 3; ?>px;
358             } 348             }
359             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-2-3 { 349             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-2-3 {
360                 height: <?php echo $grid_height * 2 / 3; ?>px; 350                 height: <?php echo $grid_height * 2 / 3; ?>px;
361             } 351             }
362             @media (max-width: 767px) { 352             @media (max-width: 767px) {
363                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1 { 353                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1 {
364                     height: <?php echo $grid_height ?>px; 354                     height: <?php echo $grid_height ?>px;
365                 } 355                 }
366                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1-2 { 356                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1-2 {
367                     height: <?php echo $grid_height / 2 ?>px; 357                     height: <?php echo $grid_height / 2 ?>px;
368                 } 358                 }
369             } 359             }
370         </style> 360         </style>
371     </div> 361     </div>
372     <script type="text/javascript"> 362     <script type="text/javascript">
373     require([ 363     require([
374         'jquery', 364         'jquery',
375         'imagesloaded', 365         'imagesloaded',
376         'packery' 366         'packery'
377     ], function ($, imagesLoaded, Packery) { 367     ], function ($, imagesLoaded, Packery) {
378         $.bridget( 'packery', Packery ); 368         $.bridget( 'packery', Packery );
379         var $container = $('.products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts').imagesLoaded(function(){ 369         var $container = $('.products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts').imagesLoaded(function(){
380             $container.packery({ 370             $container.packery({
381                 itemSelector: ".product-item", 371                 itemSelector: ".product-item",
382                 percentPosition: true 372                 percentPosition: true
383             }); 373             });
384         }); 374         });
385     }); 375     });
386     </script> 376     </script>
387     <?php if (!$block->isRedirectToCartEnabled()) : ?> 377     <?php if (!$block->isRedirectToCartEnabled()) : ?>
388         <script type="text/x-magento-init"> 378         <script type="text/x-magento-init">
389         { 379         {
390             "[data-role=tocart-form], .form.map.checkout": { 380             "[data-role=tocart-form], .form.map.checkout": {
391                 "catalogAddToCart": {} 381                 "catalogAddToCart": {}
392             } 382             }
393         } 383         }
394         </script> 384         </script>
395     <?php endif; ?> 385     <?php endif; ?>
396 <?php endif; ?> 386 <?php endif; ?>