VS_QuickLightbox - Version 1.0.0

Version Notes

This small extension will install Lightbox on product detail page

Download this release

Release Info

Developer virendra kumar sharma
Extension VS_QuickLightbox
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/VS/Lightbox/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class VS_Lightbox_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/VS/Lightbox/Model/Magnifierpos.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class VS_Lightbox_Model_Magnifierpos{
5
+ protected $_options;
6
+ const MAGNIFIERPOS_RIGHT = 'right';
7
+ const MAGNIFIERPOS_LEFT = 'left';
8
+ const MAGNIFIERPOS_TOP = 'top';
9
+ const MAGNIFIERPOS_BOTTOM = 'bottom';
10
+
11
+ public function toOptionArray(){
12
+ if (!$this->_options) {
13
+ $this->_options[] = array(
14
+ 'value'=>self::MAGNIFIERPOS_RIGHT,
15
+ 'label'=>Mage::helper('lightbox')->__('Right')
16
+ );
17
+ $this->_options[] = array(
18
+ 'value'=>self::MAGNIFIERPOS_LEFT,
19
+ 'label'=>Mage::helper('lightbox')->__('Left')
20
+ );
21
+ $this->_options[] = array(
22
+ 'value'=>self::MAGNIFIERPOS_TOP,
23
+ 'label'=>Mage::helper('lightbox')->__('Top')
24
+ );
25
+ $this->_options[] = array(
26
+ 'value'=>self::MAGNIFIERPOS_BOTTOM,
27
+ 'label'=>Mage::helper('lightbox')->__('Bottom')
28
+ );
29
+ }
30
+ return $this->_options;
31
+ }
32
+ }
app/code/community/VS/Lightbox/etc/config.xml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <VS_Lightbox>
6
+ <version>2.0</version>
7
+ </VS_Lightbox>
8
+ </modules>
9
+ <global>
10
+ <helpers>
11
+ <lightbox>
12
+ <class>VS_Lightbox_Helper</class>
13
+ </lightbox>
14
+ </helpers>
15
+ <models>
16
+ <lightbox>
17
+ <class>VS_Lightbox_Model</class>
18
+ </lightbox>
19
+ </models>
20
+ <resources>
21
+ <lightbox_setup>
22
+ <setup>
23
+ <module>VS_Lightbox</module>
24
+ </setup>
25
+ <connection>
26
+ <use>core_setup</use>
27
+ </connection>
28
+ </lightbox_setup>
29
+ <lightbox_write>
30
+ <connection>
31
+ <use>core_write</use>
32
+ </connection>
33
+ </lightbox_write>
34
+ <lightbox_read>
35
+ <connection>
36
+ <use>core_read</use>
37
+ </connection>
38
+ </lightbox_read>
39
+ </resources>
40
+ </global>
41
+ <default>
42
+ <lightbox>
43
+ <general>
44
+ <defaullightbox>1</defaullightbox>
45
+ </general>
46
+ </lightbox>
47
+ </default>
48
+ <frontend>
49
+ <layout>
50
+ <updates>
51
+ <lightbox>
52
+ <file>lightbox.xml</file>
53
+ </lightbox>
54
+ </updates>
55
+ </layout>
56
+ </frontend>
57
+ <adminhtml>
58
+ <acl>
59
+ <resources>
60
+ <admin>
61
+ <children>
62
+ <system>
63
+ <children>
64
+ <config>
65
+ <children>
66
+ <lightbox>
67
+ <title>VS Lightbox</title>
68
+ </lightbox>
69
+ </children>
70
+ </config>
71
+ </children>
72
+ </system>
73
+ </children>
74
+ </admin>
75
+ </resources>
76
+ </acl>
77
+ </adminhtml>
78
+ </config>
app/code/community/VS/Lightbox/etc/system.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <vs_extensions>
5
+ <label>VS Extensions</label>
6
+ <sort_order>195</sort_order>
7
+ </vs_extensions>
8
+ </tabs>
9
+ <sections>
10
+ <lightbox translate="label" >
11
+ <label>VS Lightbox</label>
12
+ <tab>vs_extensions</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>90</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>Lightbox Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enabled translate="label">
28
+ <label>Enabled</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </enabled>
36
+
37
+
38
+ </fields>
39
+ </general>
40
+
41
+ </groups>
42
+
43
+ </lightbox>
44
+ </sections>
45
+ </config>
app/design/frontend/default/default/layout/lightbox.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <catalog_product_view>
4
+ <reference name="head">
5
+ <action method="addJs" ifconfig="lightbox/general/enabled"><script>VS/lightbox.js</script></action>
6
+ <action method="addCss" ifconfig="lightbox/general/enabled"><stylesheet>VS/css/lightbox.css</stylesheet></action>
7
+ </reference>
8
+ <reference name="product.info.media">
9
+ <action method="setTemplate" ifconfig="lightbox/general/enabled"><template>lightbox/media.phtml</template></action>
10
+ </reference>
11
+ </catalog_product_view>
12
+
13
+ </layout>
14
+
app/design/frontend/default/default/template/lightbox/media.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product media data template
29
+ *
30
+ * @see Mage_Catalog_Block_Product_View_Media
31
+ */
32
+ ?>
33
+ <style type="text/css">
34
+ .product-view .product-img-box .product-image-zoom img {cursor:pointer !important;}
35
+ </style>
36
+
37
+ <?php
38
+ $_product = $this->getProduct();
39
+ $_helper = $this->helper('catalog/output');
40
+ ?>
41
+ <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
42
+ <p class="product-image product-image-zoom">
43
+ <?php
44
+ $_img = ' <a href="'.$this->helper('catalog/image')->init($_product, 'image').'" rel="lightbox[product]" title="'.$this->htmlEscape($this->getImageLabel()).'"><img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" /></a>';
45
+ echo $_helper->productAttribute($_product, $_img, 'image');
46
+ ?>
47
+ </p>
48
+ <p class="zoom-notice"><?php echo $this->__('Click on image to view image gallary') ?></p>
49
+
50
+ <?php else: ?>
51
+ <p class="product-image">
52
+ <?php
53
+ $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
54
+ echo $_helper->productAttribute($_product, $_img, 'image');
55
+ ?>
56
+ </p>
57
+ <?php endif; ?>
58
+ <?php if (count($this->getGalleryImages()) > 0): ?>
59
+ <div class="more-views">
60
+ <h2><?php echo $this->__('More Views') ?></h2>
61
+ <ul>
62
+ <?php foreach ($this->getGalleryImages() as $_image): ?>
63
+ <li>
64
+ <a href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>" rel="lightbox[product]" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
65
+ </li>
66
+ <?php endforeach; ?>
67
+ </ul>
68
+ </div>
69
+ <?php endif; ?>
70
+
71
+
72
+ <script type="text/javascript">
73
+
74
+ LightboxOptions = Object.extend({
75
+ fileLoadingImage: '<?php echo $this->getSkinUrl('VS/images/loading.gif');?>',
76
+ fileBottomNavCloseImage: '<?php echo $this->getSkinUrl('VS/images/closelabel.gif');?>',
77
+
78
+ overlayOpacity: 0.8, // controls transparency of shadow overlay
79
+
80
+ animate: true, // toggles resizing animations
81
+ resizeSpeed: 7, // controls the speed of the image resizing animations (1=slowest and 10=fastest)
82
+
83
+ borderSize: 10, //if you adjust the padding in the CSS, you will need to update this variable
84
+
85
+ // When grouping images this is used to write: Image # of #.
86
+ // Change it for non-english localization
87
+ labelImage: "Image",
88
+ labelOf: "of"
89
+ }, window.LightboxOptions || {});
90
+
91
+ </script>
app/etc/modules/VS_Lightbox.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <VS_Lightbox>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Catalog />
9
+ </depends>
10
+ </VS_Lightbox>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>VS_QuickLightbox</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This small extension will install Lightbox on product detail page</summary>
10
+ <description>This small extension will install Lightbox on product detail page</description>
11
+ <notes>This small extension will install Lightbox on product detail page</notes>
12
+ <authors><author><name>virendra kumar sharma</name><user>virendra</user><email>bhardwajveerendra@gmail.com</email></author></authors>
13
+ <date>2011-12-28</date>
14
+ <time>05:14:29</time>
15
+ <contents><target name="magecommunity"><dir><dir name="VS"><dir name="Lightbox"><dir name="Helper"><file name="Data.php" hash="b5bc6caddfd59fb578fcc566a1a99190"/></dir><dir name="Model"><file name="Magnifierpos.php" hash="0fa3a4ae9554967925ad1236efcbdf9c"/></dir><dir name="etc"><file name="config.xml" hash="22ae10deba6a4528bf443ade5ddd754d"/><file name="system.xml" hash="e007efb5f1ce1865d4eaa7235a2b6279"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="lightbox.xml" hash="eb7040fac70557e73a6bd273eedee555"/></dir><dir name="template"><dir name="lightbox"><file name="media.phtml" hash="e66d5524cfbc2e910d3c716662e1f6a3"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="default"><dir name="default"><file name="VS" hash=""/></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><file name="VS" hash=""/></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="VS_Lightbox.xml" hash="e43b96db35c1e87e2d59bc98e46c392a"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>