Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. <?php
  2. $_product = $this->getProduct();
  3. $_helper = $this->helper('catalog/output');
  4. $now = date("Y-m-d H:m:s");
  5. $use_zoom = themeOptions('use_zoom');
  6. $use_carousel = themeOptions('use_carousel');
  7. $thumbs_count = count($this->getGalleryImages());
  8. $_i_thumbs = 0;
  9. ?>
  10. <?php
  11.  
  12. $_mainWidth = 350;
  13. $_mainHeight = 350;
  14. $_smWidth = 68;
  15. $_smHeight = 68;
  16. $_carWidth = 344;
  17. $_zoomLeft = $_mainWidth + 17;
  18. $_zoomWidth = 350;
  19.  
  20. ?>
  21. <style>
  22. .product-view .product-img-box .more-views { width:<?php echo $_carWidth ?>px; }
  23. #zoom-window { left: <?php echo $_zoomLeft ?>px; width: <?php echo $_zoomWidth ?>px; }
  24. </style>
  25. <div class="zoom-container layout_default">
  26.  
  27. <?php include('labels.phtml') ?>
  28. <div class="main-image" >
  29. <a id="zoom" class="<?php if(!$use_zoom): ?> lightbox<?php endif;?> main-thumbnail" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>">
  30. <?php
  31. $_img = '<img class="zoom-image" src="'.$this->helper('catalog/image')->init($_product, 'image')->resize($_mainWidth,$_mainHeight).'" width="'.$_mainWidth.'" height="'.$_mainHeight.'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
  32. echo $_helper->productAttribute($_product, $_img, 'image');
  33. ?>
  34. </a>
  35. <?php if($use_zoom): ?>
  36. <div class="lightbox-btn">
  37. <a id="zoom" class="lightbox" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>">
  38. <?php echo $this->__('Enlarge') ?>
  39. </a>
  40. </div>
  41. <?php endif;?>
  42. </div>
  43.  
  44. <div class="more-views "<?php if($use_carousel && $thumbs_count > 4): ?>style="height:80px;"<?php endif; ?>">
  45. <div class="zoom-gallery slider">
  46. <?php if($thumbs_count == 0): ?>
  47. <div class="slide last">
  48. <a class="zoom-thumbnail<?php if(!$use_zoom): ?> lightbox<?php endif;?>" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>" data-easyzoom-source="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize($_mainWidth,$_mainHeight) ?>">
  49. <?php
  50. $_img = '<img class="zoom-image fade-image" src="'.$this->helper('catalog/image')->init($_product, 'thumbnail')->resize($_smWidth,$_smHeight).'" width="'.$_smWidth.'" height="'.$_smHeight.'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
  51. echo $_helper->productAttribute($_product, $_img, 'image');
  52. ?>
  53. </a>
  54. </div>
  55. <?php endif; ?>
  56. <?php if ($thumbs_count > 0): ?>
  57. <?php foreach ($this->getGalleryImages() as $_image): $_i_thumbs++; ?>
  58. <div class="slide <?php if($thumbs_count == $_i_thumbs) echo 'last'; ?>">
  59. <a class="zoom-thumbnail<?php if(!$use_zoom): ?> lightbox<?php endif;?>" href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>" data-easyzoom-source="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize($_mainWidth,$_mainHeight); ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img class="fade-image" src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize($_smWidth,$_smHeight); ?>" width="<?php echo $_smWidth ?>" height="<?php echo $_smHeight ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
  60. </div>
  61. <?php endforeach; ?>
  62. <?php endif; ?>
  63. </div>
  64. </div>
  65. <?php if($use_carousel && $thumbs_count > 4): ?>
  66. <div class="more-views-arrow prev">&nbsp;</div>
  67. <div class="more-views-arrow next">&nbsp;</div>
  68. <?php endif;?>
  69. </div>
  70.  
  71. <script type="text/javascript">
  72.  
  73. <?php if($use_zoom): ?>
  74. // Start easyZoom
  75. jQuery('#zoom')
  76. .easyZoom({
  77. parent: 'div.zoom-container',
  78. preload: '',
  79. lightboxBtn: '.lightbox-btn .lightbox'
  80. })
  81. .data('easyZoom')
  82. .gallery('a.zoom-thumbnail');
  83. <?php endif;?>
  84.  
  85. <?php if($use_carousel && $thumbs_count > 4): ?>
  86. jQuery('.more-views').iosSlider({
  87. desktopClickDrag: true,
  88. snapToChildren: true,
  89. infiniteSlider: false,
  90. navNextSelector: '.more-views-arrow.next',
  91. navPrevSelector: '.more-views-arrow.prev'
  92. });
  93. <?php endif;?>
  94.  
  95. // Start lightbox
  96. jQuery('a.lightbox').lightBox({
  97. imageLoading : '<?php echo $this->getSkinUrl('images/lightbox-ico-loading.gif') ?>',
  98. imageBtnClose : '<?php echo $this->getSkinUrl('images/lightbox-btn-close.gif') ?>',
  99. imageBtnNext : '<?php echo $this->getSkinUrl('images/lightbox-btn-next.gif') ?>',
  100. imageBtnPrev : '<?php echo $this->getSkinUrl('images/lightbox-btn-prev.gif') ?>',
  101. imageBlank : '<?php echo $this->getSkinUrl('images/lightbox-blank.gif') ?>',
  102. fixedNavigation : true
  103. });
  104. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement