84. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2021-07-21 10:21:59 +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.

84.1 Files compared

#LocationFileLast Modified
1/Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/viewgallery.phtml2021-05-01 08:04:04 +0000
2/Applications/Ampps/www/Porto v4.0.1/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/viewgallery.phtml2021-05-01 08:04:04 +0000

84.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged11024
Changed00
Inserted00
Removed00

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

84.4 Active regular expressions

No regular expressions were active.

84.5 Comparison detail

1 <?php 1 <?php
2 /** 2 /**
3  * Copyright © Magento, Inc. All rights reserved. 3  * Copyright © Magento, Inc. All rights reserved.
4  * See COPYING.txt for license details. 4  * See COPYING.txt for license details.
5  */ 5  */
6  6 
7 // @codingStandardsIgnoreFile 7 // @codingStandardsIgnoreFile
8  8 
9 /** 9 /**
10  * Product media data template 10  * Product media data template
11  * 11  *
12  * @var $block \Magento\Catalog\Block\Product\View\Gallery 12  * @var $block \Magento\Catalog\Block\Product\View\Gallery
13  */ 13  */
14 ?> 14 ?>
15 <?php 15 <?php
16 $helper = $block->getData('imageHelper'); 16 $helper = $block->getData('imageHelper');
17 $porto_helper = $this->helper('Smartwave\Porto\Helper\Data'); 17 $porto_helper = $this->helper('Smartwave\Porto\Helper\Data');
18 $_config = $porto_helper->getConfig('porto_settings/product'); 18 $_config = $porto_helper->getConfig('porto_settings/product');
19 $image_width = (isset($_config['ratio_width']) && $_config['ratio_width'])?$_config['ratio_width']:600; 19 $image_width = (isset($_config['ratio_width']) && $_config['ratio_width'])?$_config['ratio_width']:600;
20 $image_height = (isset($_config['ratio_height']) && $_config['ratio_height'])?$_config['ratio_height']:600; 20 $image_height = (isset($_config['ratio_height']) && $_config['ratio_height'])?$_config['ratio_height']:600;
21 $aspect_ratio = (isset($_config['aspect_ratio']))?$_config['aspect_ratio']:0; 21 $aspect_ratio = (isset($_config['aspect_ratio']))?$_config['aspect_ratio']:0;
22 if ($aspect_ratio) 22 if ($aspect_ratio)
23     $image_height = $image_width; 23     $image_height = $image_width;
24 $thumb_width = 100; 24 $thumb_width = 100;
25 $thumb_height = 100 * $image_height / $image_width; 25 $thumb_height = 100 * $image_height / $image_width;
26 if ($aspect_ratio) 26 if ($aspect_ratio)
27     $thumb_height = 100; 27     $thumb_height = 100;
28 $_product = $block->getProduct(); 28 $_product = $block->getProduct();
29 $page_type = $_product->getData('product_page_type'); 29 $page_type = $_product->getData('product_page_type');
30 if(!$page_type) 30 if(!$page_type)
31     $page_type = isset($_config['product_page_type'])?$_config['product_page_type']:''; 31     $page_type = isset($_config['product_page_type'])?$_config['product_page_type']:'';
32 $image_size = $_product->getData('product_image_size'); 32 $image_size = $_product->getData('product_image_size');
33 $thumbnail_type = (isset($_config['vertical_thumbnail']) && $_config['vertical_thumbnail'])?'vertical':'horizontal'; 33 $thumbnail_type = (isset($_config['vertical_thumbnail']) && $_config['vertical_thumbnail'])?'vertical':'horizontal';
34 if($page_type == 'wide_grid') { 34 if($page_type == 'wide_grid') {
35     $thumbnail_type = 'vertical'; 35     $thumbnail_type = 'vertical';
36     $thumb_width = 100; 36     $thumb_width = 100;
37     $thumb_height = 100; 37     $thumb_height = 100;
38 } 38 }
39 ?> 39 ?>
40 <?php if($page_type == 'carousel'): ?> 40 <?php if($page_type == 'carousel'): ?>
41 <?php 41 <?php
42     $gallery_images = json_decode($block->getGalleryImagesJson()); 42     $gallery_images = json_decode($block->getGalleryImagesJson());
43 ?> 43 ?>
44 <div id="gallery_images" class="owl-carousel product-image-carousel show-nav-hover"> 44 <div id="gallery_images" class="owl-carousel product-image-carousel show-nav-hover">
45     <?php foreach($gallery_images as $gallery_image): ?> 45     <?php foreach($gallery_images as $gallery_image): ?>
46     <div class="item"> 46     <div class="item">
47         <img src="<?php echo $gallery_image->img; ?>" alt=""/> 47         <img src="<?php echo $gallery_image->img; ?>" alt=""/>
48     </div> 48     </div>
49     <?php endforeach; ?> 49     <?php endforeach; ?>
50 </div> 50 </div>
51 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div> 51 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div>
52 <div class="fullwidth-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block_2")); ?></div> 52 <div class="fullwidth-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block_2")); ?></div>
53 <script type="text/javascript"> 53 <script type="text/javascript">
54   require([ 54   require([
55     'jquery', 55     'jquery',
56     'owl.carousel/owl.carousel.min' 56     'owl.carousel/owl.carousel.min'
57   ], function ($) { 57   ], function ($) {
58     $("#gallery_images").owlCarousel({ 58     $("#gallery_images").owlCarousel({
59       autoplay: false, 59       autoplay: false,
60       autoplayTimeout: 5000, 60       autoplayTimeout: 5000,
61       autoplayHoverPause: true, 61       autoplayHoverPause: true,
62       loop: true, 62       loop: true,
63       navRewind: true, 63       navRewind: true,
64       margin: 0, 64       margin: 0,
65       nav: true, 65       nav: true,
66       dots: false, 66       dots: false,
67       responsive: { 67       responsive: {
68         0: { 68         0: {
69           items:1 69           items:1
70         }, 70         },
71         768: { 71         768: {
72           items:1 72           items:1
73         }, 73         },
74         992: { 74         992: {
75           items:2 75           items:2
76         }, 76         },
77         1200: { 77         1200: {
78           items:3 78           items:3
79         } 79         }
80       } 80       }
81     }); 81     });
82     $(document).ready(function(){ 82     $(document).ready(function(){
83         $(".product-info-main > .product-info-price").after($(".short-custom-block").show().detach()); 83         $(".product-info-main > .product-info-price").after($(".short-custom-block").show().detach());
84         $(".page-main").after($(".fullwidth-custom-block").show().detach()); 84         $(".page-main").after($(".fullwidth-custom-block").show().detach());
85         $(".product-info-main > .page-title-wrapper").after($(".product-social-links").detach()); 85         $(".product-info-main > .page-title-wrapper").after($(".product-social-links").detach());
86     }); 86     });
87   }); 87   });
88 </script> 88 </script>
89 <?php elseif($page_type == 'grid'): ?> 89 <?php elseif($page_type == 'grid'): ?>
90 <?php 90 <?php
91     $gallery_images = json_decode($block->getGalleryImagesJson()); 91     $gallery_images = json_decode($block->getGalleryImagesJson());
92 ?> 92 ?>
93 <div id="gallery_images" class="row"> 93 <div id="gallery_images" class="row">
94     <?php foreach($gallery_images as $gallery_image): ?> 94     <?php foreach($gallery_images as $gallery_image): ?>
95     <div class="col-sm-6"> 95     <div class="col-sm-6">
96         <div class="product-image-grid"> 96         <div class="product-image-grid">
97             <img src="<?php echo $gallery_image->img; ?>" alt=""/> 97             <img src="<?php echo $gallery_image->img; ?>" alt=""/>
98         </div> 98         </div>
99     </div> 99     </div>
100     <?php endforeach; ?> 100     <?php endforeach; ?>
101 </div> 101 </div>
102 <?php elseif($page_type == 'sticky_right'): ?> 102 <?php elseif($page_type == 'sticky_right'): ?>
103 <?php 103 <?php
104     $gallery_images = json_decode($block->getGalleryImagesJson()); 104     $gallery_images = json_decode($block->getGalleryImagesJson());
105 ?> 105 ?>
106 <div id="gallery_images"> 106 <div id="gallery_images">
107     <?php foreach($gallery_images as $gallery_image): ?> 107     <?php foreach($gallery_images as $gallery_image): ?>
108     <div class="product-image-list"> 108     <div class="product-image-list">
109         <img src="<?php echo $gallery_image->img; ?>" alt=""/> 109         <img src="<?php echo $gallery_image->img; ?>" alt=""/>
110     </div> 110     </div>
111     <?php endforeach; ?> 111     <?php endforeach; ?>
112 </div> 112 </div>
113 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div> 113 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div>
114 <script type="text/javascript"> 114 <script type="text/javascript">
115 require([ 115 require([
116     'jquery' 116     'jquery'
117 ], function ($) { 117 ], function ($) {
118     var product_info_top = 0; 118     var product_info_top = 0;
119     var product_image_box_pos = $(".product.media").offset().top; 119     var product_image_box_pos = $(".product.media").offset().top;
120     $(".product.detailed").before($(".short-custom-block").show().detach()).before($(".product-social-links").detach()); 120     $(".product.detailed").before($(".short-custom-block").show().detach()).before($(".product-social-links").detach());
121     $(window).scroll(function(){ 121     $(window).scroll(function(){
122         product_image_box_pos = $(".product.media").offset().top; 122         product_image_box_pos = $(".product.media").offset().top;
123         if($(window).innerWidth() >= 768) { 123         if($(window).innerWidth() >= 768) {
124             $(".product-info-main").each(function(){ 124             $(".product-info-main").each(function(){
125                 if(($(window).scrollTop() > product_image_box_pos - 50) && (product_image_box_pos + $(".product.media").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) { 125                 if(($(window).scrollTop() > product_image_box_pos - 50) && (product_image_box_pos + $(".product.media").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) {
126                     product_info_top = $(window).scrollTop() - product_image_box_pos + 50; 126                     product_info_top = $(window).scrollTop() - product_image_box_pos + 50;
127                     $(this).css('top',product_info_top + 'px'); 127                     $(this).css('top',product_info_top + 'px');
128                 } else if ($(window).scrollTop() < product_image_box_pos || $(".product.media").outerHeight() < $(this).outerHeight()) { 128                 } else if ($(window).scrollTop() < product_image_box_pos || $(".product.media").outerHeight() < $(this).outerHeight()) {
129                     product_info_top = 0; 129                     product_info_top = 0;
130                     $(this).css('top',product_info_top + 'px'); 130                     $(this).css('top',product_info_top + 'px');
131                 } else { 131                 } else {
132                     product_info_top = $(".product.media").outerHeight() - $(this).outerHeight(); 132                     product_info_top = $(".product.media").outerHeight() - $(this).outerHeight();
133                     $(this).css('top',product_info_top + 'px'); 133                     $(this).css('top',product_info_top + 'px');
134                 } 134                 }
135             }); 135             });
136         } else { 136         } else {
137             product_info_top = 0; 137             product_info_top = 0;
138             $(".product-info-main").css('top',product_info_top + 'px'); 138             $(".product-info-main").css('top',product_info_top + 'px');
139         } 139         }
140     }); 140     });
141     $(window).resize(function(){ 141     $(window).resize(function(){
142         product_image_box_pos = $(".product.media").offset().top; 142         product_image_box_pos = $(".product.media").offset().top;
143         if($(window).innerWidth() >= 992) { 143         if($(window).innerWidth() >= 992) {
144             $(".product-info-main").each(function(){ 144             $(".product-info-main").each(function(){
145                 if(($(window).scrollTop() > product_image_box_pos - 50) && (product_image_box_pos + $(".product.media").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) { 145                 if(($(window).scrollTop() > product_image_box_pos - 50) && (product_image_box_pos + $(".product.media").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) {
146                     product_info_top = $(window).scrollTop() - product_image_box_pos + 50; 146                     product_info_top = $(window).scrollTop() - product_image_box_pos + 50;
147                     $(this).css('top',product_info_top + 'px'); 147                     $(this).css('top',product_info_top + 'px');
148                 } else if ($(window).scrollTop() < product_image_box_pos || $(".product.media").outerHeight() < $(this).outerHeight()) { 148                 } else if ($(window).scrollTop() < product_image_box_pos || $(".product.media").outerHeight() < $(this).outerHeight()) {
149                     product_info_top = 0; 149                     product_info_top = 0;
150                     $(this).css('top',product_info_top + 'px'); 150                     $(this).css('top',product_info_top + 'px');
151                 } else { 151                 } else {
152                     product_info_top = $(".product.media").outerHeight() - $(this).outerHeight(); 152                     product_info_top = $(".product.media").outerHeight() - $(this).outerHeight();
153                     $(this).css('top',product_info_top + 'px'); 153                     $(this).css('top',product_info_top + 'px');
154                 } 154                 }
155             }); 155             });
156         } else { 156         } else {
157             product_info_top = 0; 157             product_info_top = 0;
158             $(".product-info-main").css('top',product_info_top + 'px'); 158             $(".product-info-main").css('top',product_info_top + 'px');
159         } 159         }
160     }); 160     });
161 }); 161 });
162 </script> 162 </script>
163 <?php elseif($page_type == 'fullwidth'): ?> 163 <?php elseif($page_type == 'fullwidth'): ?>
164 <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder"> 164 <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
165     <div data-role="loader" class="loading-mask"> 165     <div data-role="loader" class="loading-mask">
166         <div class="loader"> 166         <div class="loader">
167             <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>" 167             <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"
168                  alt="<?php /* @escapeNotVerified */ echo __('Loading...') ?>"> 168                  alt="<?php /* @escapeNotVerified */ echo __('Loading...') ?>">
169         </div> 169         </div>
170     </div> 170     </div>
171 </div> 171 </div>
172 <!--Fix for jumping content. Loader must be the same size as gallery.--> 172 <!--Fix for jumping content. Loader must be the same size as gallery.-->
173 <script> 173 <script>
174     var config = { 174     var config = {
175             "width": <?php /* @escapeNotVerified */ echo $image_width; ?>, 175             "width": <?php /* @escapeNotVerified */ echo $image_width; ?>,
176             "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height') 176             "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
177                         ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>, 177                         ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
178             "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>", 178             "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>",
179             <?php if (!$aspect_ratio): ?> 179             <?php if (!$aspect_ratio): ?>
180                 "height": <?php /* @escapeNotVerified */ echo $image_height; ?> 180                 "height": <?php /* @escapeNotVerified */ echo $image_height; ?>
181             <?php endif; ?> 181             <?php endif; ?>
182         }, 182         },
183         thumbBarHeight = 0, 183         thumbBarHeight = 0,
184         loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0]; 184         loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0];
185  185 
186     if (config.navtype === 'horizontal') { 186     if (config.navtype === 'horizontal') {
187         thumbBarHeight = config.thumbheight; 187         thumbBarHeight = config.thumbheight;
188     } 188     }
189  189 
190     loader.style.paddingBottom = ( config.height / config.width * 100) + "%"; 190     loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
191 </script> 191 </script>
192 <script type="text/x-magento-init"> 192 <script type="text/x-magento-init">
193     { 193     {
194         "[data-gallery-role=gallery-placeholder]": { 194         "[data-gallery-role=gallery-placeholder]": {
195             "mage/gallery/gallery": { 195             "mage/gallery/gallery": {
196                 "mixins":["magnifier/magnify"], 196                 "mixins":["magnifier/magnify"],
197                 "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>, 197                 "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>,
198                 "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>, 198                 "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>,
199                 "options": { 199                 "options": {
200                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>", 200                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>",
201                     <?php if (($block->getVar("gallery/loop"))): ?> 201                     <?php if (($block->getVar("gallery/loop"))): ?>
202                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ?>, 202                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ?>,
203                     <?php endif; ?> 203                     <?php endif; ?>
204                     <?php if (($block->getVar("gallery/keyboard"))): ?> 204                     <?php if (($block->getVar("gallery/keyboard"))): ?>
205                         "keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ?>, 205                         "keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ?>,
206                     <?php endif; ?> 206                     <?php endif; ?>
207                     <?php if (($block->getVar("gallery/arrows"))): ?> 207                     <?php if (($block->getVar("gallery/arrows"))): ?>
208                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ?>, 208                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ?>,
209                     <?php endif; ?> 209                     <?php endif; ?>
210                     <?php if (($block->getVar("gallery/allowfullscreen"))): ?> 210                     <?php if (($block->getVar("gallery/allowfullscreen"))): ?>
211                         "allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ?>, 211                         "allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ?>,
212                     <?php endif; ?> 212                     <?php endif; ?>
213                     <?php if (($block->getVar("gallery/caption"))): ?> 213                     <?php if (($block->getVar("gallery/caption"))): ?>
214                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>, 214                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>,
215                     <?php endif; ?> 215                     <?php endif; ?>
216                     "width": <?php /* @escapeNotVerified */ echo $image_width; ?>, 216                     "width": <?php /* @escapeNotVerified */ echo $image_width; ?>,
217                     "thumbwidth": <?php /* @escapeNotVerified */ echo $thumb_width; ?>, 217                     "thumbwidth": <?php /* @escapeNotVerified */ echo $thumb_width; ?>,
218                     "thumbheight": <?php /* @escapeNotVerified */ echo $thumb_height; ?>, 218                     "thumbheight": <?php /* @escapeNotVerified */ echo $thumb_height; ?>,
219                     <?php if(!$aspect_ratio): ?> 219                     <?php if(!$aspect_ratio): ?>
220                     "height": <?php /* @escapeNotVerified */ echo $image_height; ?>, 220                     "height": <?php /* @escapeNotVerified */ echo $image_height; ?>,
221                     <?php endif; ?> 221                     <?php endif; ?>
222                     "thumbmargin": <?php echo $block->getVar("gallery/thumbmargin") ?>, 222                     "thumbmargin": <?php echo $block->getVar("gallery/thumbmargin") ?>,
223                     <?php if ($block->getVar("gallery/transition/duration")): ?> 223                     <?php if ($block->getVar("gallery/transition/duration")): ?>
224                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>, 224                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>,
225                     <?php endif; ?> 225                     <?php endif; ?>
226                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>", 226                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>",
227                     <?php if (($block->getVar("gallery/navarrows"))): ?> 227                     <?php if (($block->getVar("gallery/navarrows"))): ?>
228                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ?>, 228                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ?>,
229                     <?php endif; ?> 229                     <?php endif; ?>
230                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>", 230                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>",
231                     "navdir": "vertical" 231                     "navdir": "vertical"
232                 }, 232                 },
233                 "fullscreen": { 233                 "fullscreen": {
234                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>", 234                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>",
235                     <?php if ($block->getVar("gallery/fullscreen/loop")): ?> 235                     <?php if ($block->getVar("gallery/fullscreen/loop")): ?>
236                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ?>, 236                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ?>,
237                     <?php endif; ?> 237                     <?php endif; ?>
238                     "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>", 238                     "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>",
239                     <?php if ($block->getVar("gallery/transition/navarrows")): ?> 239                     <?php if ($block->getVar("gallery/transition/navarrows")): ?>
240                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ?>, 240                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ?>,
241                     <?php endif; ?> 241                     <?php endif; ?>
242                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>", 242                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>",
243                     <?php if ($block->getVar("gallery/fullscreen/arrows")): ?> 243                     <?php if ($block->getVar("gallery/fullscreen/arrows")): ?>
244                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ?>, 244                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ?>,
245                     <?php endif; ?> 245                     <?php endif; ?>
246                     <?php if ($block->getVar("gallery/fullscreen/caption")): ?> 246                     <?php if ($block->getVar("gallery/fullscreen/caption")): ?>
247                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ?>, 247                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ?>,
248                     <?php endif; ?> 248                     <?php endif; ?>
249                     <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?> 249                     <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?>
250                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>, 250                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>,
251                     <?php endif; ?> 251                     <?php endif; ?>
252                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/effect") ?>" 252                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/effect") ?>"
253                 }, 253                 },
254                 "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?> 254                 "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?>
255             } 255             }
256         } 256         }
257     } 257     }
258 </script> 258 </script>
259 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div> 259 <div class="short-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block")); ?></div>
260 <div class="fullwidth-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block_2")); ?></div> 260 <div class="fullwidth-custom-block" style="display: none;"><?php echo $porto_helper->filterContent($_product->getData("custom_block_2")); ?></div>
261 <script type="text/javascript"> 261 <script type="text/javascript">
262     require([ 262     require([
263         'jquery' 263         'jquery'
264     ], function($){ 264     ], function($){
265         $(document).on('fotorama:load', function(e, fotorama, extra){ 265         $(document).on('fotorama:load', function(e, fotorama, extra){
266             if($('.loading-mask').length>0) 266             if($('.loading-mask').length>0)
267                 $('.loading-mask').remove(); 267                 $('.loading-mask').remove();
268         }); 268         });
269         $(document).ready(function(){ 269         $(document).ready(function(){
270             $(".product.info.detailed").detach().appendTo($(".product-info-main")); 270             $(".product.info.detailed").detach().appendTo($(".product-info-main"));
271             $(".page-main").after($(".fullwidth-custom-block").show().detach()); 271             $(".page-main").after($(".fullwidth-custom-block").show().detach());
272             $(".page-title-wrapper.product").before($(".short-custom-block").show().detach()); 272             $(".page-title-wrapper.product").before($(".short-custom-block").show().detach());
273         }); 273         });
274         var product_image_box_top = 0; 274         var product_image_box_top = 0;
275         var product_info_pos = $(".product-info-main").offset().top; 275         var product_info_pos = $(".product-info-main").offset().top;
276         $(window).scroll(function(){ 276         $(window).scroll(function(){
277             product_info_pos = $(".product-info-main").offset().top; 277             product_info_pos = $(".product-info-main").offset().top;
278             if($(window).innerWidth() >= 768) { 278             if($(window).innerWidth() >= 768) {
279                 $(".product.media").each(function(){ 279                 $(".product.media").each(function(){
280                     if(($(window).scrollTop() > product_info_pos - 50) && (product_info_pos + $(".product-info-main").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) { 280                     if(($(window).scrollTop() > product_info_pos - 50) && (product_info_pos + $(".product-info-main").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) {
281                         product_image_box_top = $(window).scrollTop() - product_info_pos + 50; 281                         product_image_box_top = $(window).scrollTop() - product_info_pos + 50;
282                         $(this).css('top',product_image_box_top + 'px'); 282                         $(this).css('top',product_image_box_top + 'px');
283                     } else if ($(window).scrollTop() < product_info_pos) { 283                     } else if ($(window).scrollTop() < product_info_pos) {
284                         product_image_box_top = 0; 284                         product_image_box_top = 0;
285                         $(this).css('top',product_image_box_top + 'px'); 285                         $(this).css('top',product_image_box_top + 'px');
286                     } 286                     }
287                 }); 287                 });
288             } else { 288             } else {
289                 product_image_box_top = 0; 289                 product_image_box_top = 0;
290                 $(".product.media").css('top',product_image_box_top + 'px'); 290                 $(".product.media").css('top',product_image_box_top + 'px');
291             } 291             }
292         }); 292         });
293         $(window).resize(function(){ 293         $(window).resize(function(){
294             product_info_pos = $(".product-info-main").offset().top; 294             product_info_pos = $(".product-info-main").offset().top;
295             if($(window).innerWidth() >= 768) { 295             if($(window).innerWidth() >= 768) {
296                 $(".product.media").each(function(){ 296                 $(".product.media").each(function(){
297                     if(($(window).scrollTop() > product_info_pos - 50) && (product_info_pos + $(".product-info-main").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) { 297                     if(($(window).scrollTop() > product_info_pos - 50) && (product_info_pos + $(".product-info-main").outerHeight()) > ($(window).scrollTop() + $(this).outerHeight() + 50)) {
298                         product_image_box_top = $(window).scrollTop() - product_info_pos + 50; 298                         product_image_box_top = $(window).scrollTop() - product_info_pos + 50;
299                         $(this).css('top',product_image_box_top + 'px'); 299                         $(this).css('top',product_image_box_top + 'px');
300                     } else if ($(window).scrollTop() < product_info_pos) { 300                     } else if ($(window).scrollTop() < product_info_pos) {
301                         product_image_box_top = 0; 301                         product_image_box_top = 0;
302                         $(this).css('top',product_image_box_top + 'px'); 302                         $(this).css('top',product_image_box_top + 'px');
303                     } 303                     }
304                 }); 304                 });
305             } else { 305             } else {
306                 product_image_box_top = 0; 306                 product_image_box_top = 0;
307                 $(".product.media").css('top',product_image_box_top + 'px'); 307                 $(".product.media").css('top',product_image_box_top + 'px');
308             } 308             }
309         }); 309         });
310     }); 310     });
311 </script> 311 </script>
312 <style> 312 <style>
313 .fotorama__nav-wrap--vertical .fotorama__nav__shaft {margin-top: -<?php echo $block->getVar("gallery/thumbmargin") ?>px;} 313 .fotorama__nav-wrap--vertical .fotorama__nav__shaft {margin-top: -<?php echo $block->getVar("gallery/thumbmargin") ?>px;}
314 @media (min-width:768px) { 314 @media (min-width:768px) {
315   .fotorama__stage { 315   .fotorama__stage {
316     max-width: calc(100% - <?php echo ($block->getVar("gallery/thumbmargin") + $thumb_width); ?>px); 316     max-width: calc(100% - <?php echo ($block->getVar("gallery/thumbmargin") + $thumb_width); ?>px);
317   } 317   }
318 } 318 }
319 </style> 319 </style>
320 <?php else: ?> 320 <?php else: ?>
321 <?php 321 <?php
322 $images = $block->getGalleryImages()->getItems(); 322 $images = $block->getGalleryImages()->getItems();
323 $mainImage = current(array_filter($images, function ($img) use ($block) { 323 $mainImage = current(array_filter($images, function ($img) use ($block) {
324     return $block->isMainImage($img); 324     return $block->isMainImage($img);
325 })); 325 }));
326 if (!empty($images) && empty($mainImage)) { 326 if (!empty($images) && empty($mainImage)) {
327     $mainImage = $block->getGalleryImages()->getFirstItem(); 327     $mainImage = $block->getGalleryImages()->getFirstItem();
328 } 328 }
329 $mainImageData = $mainImage ? 329 $mainImageData = $mainImage ?
330     $mainImage->getData('medium_image_url') : 330     $mainImage->getData('medium_image_url') :
331     $helper->getDefaultPlaceholderUrl('image'); 331     $helper->getDefaultPlaceholderUrl('image');
332  332 
333 ?> 333 ?>
334 <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder"> 334 <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
335     <img 335     <img
336         alt="main product photo" 336         alt="main product photo"
337         class="gallery-placeholder__image" 337         class="gallery-placeholder__image"
338         src="<?= /* @noEscape */ $mainImageData ?>" 338         src="<?= /* @noEscape */ $mainImageData ?>"
339     /> 339     />
340     <div data-role="loader" class="loading-mask"> 340     <div data-role="loader" class="loading-mask">
341         <div class="loader"> 341         <div class="loader">
342             <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>" 342             <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"
343                  alt="<?php /* @escapeNotVerified */ echo __('Loading...') ?>"> 343                  alt="<?php /* @escapeNotVerified */ echo __('Loading...') ?>">
344         </div> 344         </div>
345     </div> 345     </div>
346 </div> 346 </div>
347 <style> 347 <style>
348 <?php if($thumbnail_type != 'vertical'):?> 348 <?php if($thumbnail_type != 'vertical'):?>
349 .fotorama__wrap { 349 .fotorama__wrap {
350     margin-bottom: -<?php echo $block->getVar("gallery/thumbmargin") ?>px; 350     margin-bottom: -<?php echo $block->getVar("gallery/thumbmargin") ?>px;
351 } 351 }
352 <?php endif;?> 352 <?php endif;?>
353 <?php if($thumbnail_type == 'vertical'):?> 353 <?php if($thumbnail_type == 'vertical'):?>
354 .fotorama__nav-wrap--vertical .fotorama__nav__shaft {margin-top: -<?php echo $block->getVar("gallery/thumbmargin") ?>px;} 354 .fotorama__nav-wrap--vertical .fotorama__nav__shaft {margin-top: -<?php echo $block->getVar("gallery/thumbmargin") ?>px;}
355 @media (min-width:992px) { 355 @media (min-width:992px) {
356   .fotorama__stage { 356   .fotorama__stage {
357     max-width: calc(100% - <?php echo ($block->getVar("gallery/thumbmargin") + $thumb_width); ?>px); 357     max-width: calc(100% - <?php echo ($block->getVar("gallery/thumbmargin") + $thumb_width); ?>px);
358   } 358   }
359 } 359 }
360 <?php endif;?> 360 <?php endif;?>
361 </style> 361 </style>
362 <!--Fix for jumping content. Loader must be the same size as gallery.--> 362 <!--Fix for jumping content. Loader must be the same size as gallery.-->
363 <script> 363 <script>
364     var config = { 364     var config = {
365             "width": <?php /* @escapeNotVerified */ echo $image_width; ?>, 365             "width": <?php /* @escapeNotVerified */ echo $image_width; ?>,
366             "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height') 366             "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
367                         ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>, 367                         ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
368             "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>", 368             "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>",
369             <?php if (!$aspect_ratio): ?> 369             <?php if (!$aspect_ratio): ?>
370                 "height": <?php /* @escapeNotVerified */ echo $image_height; ?> 370                 "height": <?php /* @escapeNotVerified */ echo $image_height; ?>
371             <?php endif; ?> 371             <?php endif; ?>
372         }, 372         },
373         thumbBarHeight = 0, 373         thumbBarHeight = 0,
374         loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0]; 374         loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0];
375  375 
376     if (config.navtype === 'horizontal') { 376     if (config.navtype === 'horizontal') {
377         thumbBarHeight = config.thumbheight; 377         thumbBarHeight = config.thumbheight;
378     } 378     }
379  379 
380     loader.style.paddingBottom = ( config.height / config.width * 100) + "%"; 380     loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
381 </script> 381 </script>
382 <script type="text/x-magento-init"> 382 <script type="text/x-magento-init">
383     { 383     {
384         "[data-gallery-role=gallery-placeholder]": { 384         "[data-gallery-role=gallery-placeholder]": {
385             "mage/gallery/gallery": { 385             "mage/gallery/gallery": {
386                 "mixins":["magnifier/magnify"], 386                 "mixins":["magnifier/magnify"],
387                 "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>, 387                 "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>,
388                 "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>, 388                 "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>,
389                 "options": { 389                 "options": {
390                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>", 390                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>",
391                     <?php if (($block->getVar("gallery/loop"))): ?> 391                     <?php if (($block->getVar("gallery/loop"))): ?>
392                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ?>, 392                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ?>,
393                     <?php endif; ?> 393                     <?php endif; ?>
394                     <?php if (($block->getVar("gallery/keyboard"))): ?> 394                     <?php if (($block->getVar("gallery/keyboard"))): ?>
395                         "keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ?>, 395                         "keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ?>,
396                     <?php endif; ?> 396                     <?php endif; ?>
397                     <?php if (($block->getVar("gallery/arrows"))): ?> 397                     <?php if (($block->getVar("gallery/arrows"))): ?>
398                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ?>, 398                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ?>,
399                     <?php endif; ?> 399                     <?php endif; ?>
400                     <?php if (($block->getVar("gallery/allowfullscreen"))): ?> 400                     <?php if (($block->getVar("gallery/allowfullscreen"))): ?>
401                         "allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ?>, 401                         "allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ?>,
402                     <?php endif; ?> 402                     <?php endif; ?>
403                     <?php if (($block->getVar("gallery/caption"))): ?> 403                     <?php if (($block->getVar("gallery/caption"))): ?>
404                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>, 404                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>,
405                     <?php endif; ?> 405                     <?php endif; ?>
406                     "width": <?php /* @escapeNotVerified */ echo $image_width; ?>, 406                     "width": <?php /* @escapeNotVerified */ echo $image_width; ?>,
407                     "thumbwidth": <?php /* @escapeNotVerified */ echo $thumb_width; ?>, 407                     "thumbwidth": <?php /* @escapeNotVerified */ echo $thumb_width; ?>,
408                     "thumbheight": <?php /* @escapeNotVerified */ echo $thumb_height; ?>, 408                     "thumbheight": <?php /* @escapeNotVerified */ echo $thumb_height; ?>,
409                     <?php if(!$aspect_ratio): ?> 409                     <?php if(!$aspect_ratio): ?>
410                     "height": <?php /* @escapeNotVerified */ echo $image_height; ?>, 410                     "height": <?php /* @escapeNotVerified */ echo $image_height; ?>,
411                     <?php endif; ?> 411                     <?php endif; ?>
412                     "thumbmargin": <?php echo $block->getVar("gallery/thumbmargin") ?>, 412                     "thumbmargin": <?php echo $block->getVar("gallery/thumbmargin") ?>,
413                     <?php if ($block->getVar("gallery/transition/duration")): ?> 413                     <?php if ($block->getVar("gallery/transition/duration")): ?>
414                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>, 414                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>,
415                     <?php endif; ?> 415                     <?php endif; ?>
416                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>", 416                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>",
417                     <?php if (($block->getVar("gallery/navarrows"))): ?> 417                     <?php if (($block->getVar("gallery/navarrows"))): ?>
418                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ?>, 418                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ?>,
419                     <?php endif; ?> 419                     <?php endif; ?>
420                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>", 420                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>",
421                     "navdir": "<?= /* @escapeNotVerified */ $thumbnail_type ?>" 421                     "navdir": "<?= /* @escapeNotVerified */ $thumbnail_type ?>"
422                 }, 422                 },
423                 "fullscreen": { 423                 "fullscreen": {
424                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>", 424                     "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>",
425                     <?php if ($block->getVar("gallery/fullscreen/loop")): ?> 425                     <?php if ($block->getVar("gallery/fullscreen/loop")): ?>
426                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ?>, 426                         "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ?>,
427                     <?php endif; ?> 427                     <?php endif; ?>
428                     "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>", 428                     "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>",
429                     <?php if ($block->getVar("gallery/transition/navarrows")): ?> 429                     <?php if ($block->getVar("gallery/transition/navarrows")): ?>
430                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ?>, 430                         "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ?>,
431                     <?php endif; ?> 431                     <?php endif; ?>
432                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>", 432                     "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>",
433                     <?php if ($block->getVar("gallery/fullscreen/arrows")): ?> 433                     <?php if ($block->getVar("gallery/fullscreen/arrows")): ?>
434                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ?>, 434                         "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ?>,
435                     <?php endif; ?> 435                     <?php endif; ?>
436                     <?php if ($block->getVar("gallery/fullscreen/caption")): ?> 436                     <?php if ($block->getVar("gallery/fullscreen/caption")): ?>
437                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ?>, 437                         "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ?>,
438                     <?php endif; ?> 438                     <?php endif; ?>
439                     <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?> 439                     <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?>
440                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>, 440                         "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>,
441                     <?php endif; ?> 441                     <?php endif; ?>
442                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/effect") ?>" 442                     "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/effect") ?>"
443                 }, 443                 },
444                 "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?> 444                 "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?>
445             } 445             }
446         } 446         }
447     } 447     }
448 </script> 448 </script>
449 <script type="text/javascript"> 449 <script type="text/javascript">
450 require([ 450 require([
451     'jquery', 451     'jquery',
452     'Magento_Catalog/js/jquery.zoom.min' 452     'Magento_Catalog/js/jquery.zoom.min'
453 ], function ($) { 453 ], function ($) {
454     var loaded = false; 454     var loaded = false;
455     $(document).on('fotorama:load', function(e, fotorama, extra){ 455     $(document).on('fotorama:load', function(e, fotorama, extra){
456         if($('.loading-mask').length>0) 456         if($('.loading-mask').length>0)
457             $('.loading-mask').remove(); 457             $('.loading-mask').remove();
458     }); 458     });
459     $('.product.media .gallery-placeholder').bind("DOMSubtreeModified",function(){ 459     $('.product.media .gallery-placeholder').bind("DOMSubtreeModified",function(){
460         $('.product.media .fotorama').on('fotorama:ready', function (e, fotorama, extra) { 460         $('.product.media .fotorama').on('fotorama:ready', function (e, fotorama, extra) {
461             loaded = false; 461             loaded = false;
462             $('.product.media .fotorama').on('fotorama:load', function (e, fotorama, extra) { 462             $('.product.media .fotorama').on('fotorama:load', function (e, fotorama, extra) {
463                 if(!loaded){ 463                 if(!loaded){
464                     $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy'); 464                     $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy');
465                     $('.product.media .fotorama__stage .fotorama__active').zoom({ 465                     $('.product.media .fotorama__stage .fotorama__active').zoom({
466                         touch:false 466                         touch:false
467                     }); 467                     });
468                     loaded = true; 468                     loaded = true;
469                 } 469                 }
470             }); 470             });
471             $('.product.media .fotorama').on('fotorama:showend', function (e, fotorama, extra) { 471             $('.product.media .fotorama').on('fotorama:showend', function (e, fotorama, extra) {
472                 $('.product.media .fotorama__stage .fotorama__active').zoom({ 472                 $('.product.media .fotorama__stage .fotorama__active').zoom({
473                     touch:false 473                     touch:false
474                 }); 474                 });
475             }); 475             });
476             $('.fotorama').off('fotorama:fullscreenenter').on('fotorama:fullscreenenter', function (e, fotorama, extra) { 476             $('.fotorama').off('fotorama:fullscreenenter').on('fotorama:fullscreenenter', function (e, fotorama, extra) {
477                 $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy'); 477                 $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy');
478                 $('img.zoomImg').remove(); 478                 $('img.zoomImg').remove();
479             }); 479             });
480             $('.fotorama').off('fotorama:fullscreenexit').on('fotorama:fullscreenexit', function (e, fotorama, extra) { 480             $('.fotorama').off('fotorama:fullscreenexit').on('fotorama:fullscreenexit', function (e, fotorama, extra) {
481                 $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy'); 481                 $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy');
482                 $('img.zoomImg').remove(); 482                 $('img.zoomImg').remove();
483                 $('img.fotorama__img').not('.fotorama__img--full').each(function(){ 483                 $('img.fotorama__img').not('.fotorama__img--full').each(function(){
484                     $(this).after($(this).parent().children("img.fotorama__img--full")); 484                     $(this).after($(this).parent().children("img.fotorama__img--full"));
485                 }); 485                 });
486                 $('.product.media .fotorama__stage .fotorama__active').zoom({ 486                 $('.product.media .fotorama__stage .fotorama__active').zoom({
487                     touch:false 487                     touch:false
488                 }); 488                 });
489                 $('.product.media .fotorama').off('fotorama:showend').on('fotorama:showend', function (e, fotorama, extra) { 489                 $('.product.media .fotorama').off('fotorama:showend').on('fotorama:showend', function (e, fotorama, extra) {
490                     $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy'); 490                     $('.product.media .fotorama__stage .fotorama__loaded--img').trigger('zoom.destroy');
491                     $('.product.media .fotorama__stage .fotorama__active').zoom({ 491                     $('.product.media .fotorama__stage .fotorama__active').zoom({
492                         touch:false 492                         touch:false
493                     }); 493                     });
494                 }); 494                 });
495             }); 495             });
496         }); 496         });
497     }); 497     });
498 }); 498 });
499 </script> 499 </script>
500 <?php endif; ?> 500 <?php endif; ?>
501 <?php if ($image_size): ?> 501 <?php if ($image_size): ?>
502 <style type="text/css"> 502 <style type="text/css">
503     @media (min-width: 768px) { 503     @media (min-width: 768px) {
504         .product.media { 504         .product.media {
505             width: <?php echo $image_size * 100 / 12 - 2; ?>% !important; 505             width: <?php echo $image_size * 100 / 12 - 2; ?>% !important;
506         } 506         }
507         .product-info-main { 507         .product-info-main {
508             width: <?php echo (12 - $image_size) * 100 / 12; ?>% !important; 508             width: <?php echo (12 - $image_size) * 100 / 12; ?>% !important;
509         } 509         }
510     } 510     }
511 </style> 511 </style>
512 <?php endif; ?> 512 <?php endif; ?>