Grasshopperpebbles_Configurablecolors - Version 1.0.1

Version Notes

Stable

Version Number 1.0.1
Updated Image Zoom Options
Fixed jQuery noConflict bug in admin

Version number: 1.0.0
Stability: Stable
Compatibility: 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7

Download this release

Release Info

Developer Les Green
Extension Grasshopperpebbles_Configurablecolors
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Grasshopperpebbles/Configurablecolors/Adminhtml/Model/System/Config/Source/Zoomposition.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Grasshopperpebbles_Configurablecolors_Adminhtml_Model_System_Config_Source_Zoomposition
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>'inside', 'label'=>Mage::helper('adminhtml')->__('Inside')),
8
+ array('value'=>'left', 'label'=>Mage::helper('adminhtml')->__('Left')),
9
+ array('value'=>'right', 'label'=>Mage::helper('adminhtml')->__('Right')),
10
+ );
11
+ }
12
+
13
+ }
app/code/community/Grasshopperpebbles/Configurablecolors/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Grasshopperpebbles_Configurablecolors>
5
- <version>1.0.0</version>
6
  </Grasshopperpebbles_Configurablecolors>
7
  </modules>
8
  <adminhtml>
@@ -53,6 +53,14 @@
53
  </frontend>
54
  <global>
55
  <blocks>
 
 
 
 
 
 
 
 
56
  <configurablecolors>
57
  <class>Grasshopperpebbles_Configurablecolors_Block</class>
58
  </configurablecolors>
@@ -60,8 +68,32 @@
60
  <models>
61
  <configurablecolors>
62
  <class>Grasshopperpebbles_Configurablecolors_Model</class>
 
63
  </configurablecolors>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </models>
 
 
 
 
 
 
 
 
 
65
  <helpers>
66
  <configurablecolors>
67
  <class>Grasshopperpebbles_Configurablecolors_Helper</class>
@@ -75,10 +107,15 @@
75
  <thumb_height></thumb_height>
76
  <image_width>365</image_width>
77
  <image_height></image_height>
78
- <show_zoom>1</show_zoom>
79
- <zoom_width>1000</zoom_width>
80
- <zoom_height></zoom_height>
81
  </images>
 
 
 
 
 
 
 
 
82
  <color_options>
83
  <color_map></color_map>
84
  </color_options>
2
  <config>
3
  <modules>
4
  <Grasshopperpebbles_Configurablecolors>
5
+ <version>1.0.1</version>
6
  </Grasshopperpebbles_Configurablecolors>
7
  </modules>
8
  <adminhtml>
53
  </frontend>
54
  <global>
55
  <blocks>
56
+ <catalog>
57
+ <rewrite>
58
+ <product_view_media>Grasshopperpebbles_Configurablecolors_Catalog_Block_Product_View_Media</product_view_media>
59
+ </rewrite>
60
+ </catalog>
61
+ <!--<moo>
62
+ <class>Moo_Catalog_Block</class>
63
+ </moo> -->
64
  <configurablecolors>
65
  <class>Grasshopperpebbles_Configurablecolors_Block</class>
66
  </configurablecolors>
68
  <models>
69
  <configurablecolors>
70
  <class>Grasshopperpebbles_Configurablecolors_Model</class>
71
+ <!--<resourceModel>configurablecolors_resource</resourceModel> -->
72
  </configurablecolors>
73
+ <configurablecolors_adminhtml>
74
+ <class>Grasshopperpebbles_Configurablecolors_Adminhtml_Model</class>
75
+ </configurablecolors_adminhtml>
76
+ <!--> <configurablecolors_resource>
77
+ <class>Grasshopperpebbles_Model_Resource</class>
78
+ <entities>
79
+ <settings>
80
+ <table>configurablecolors_settings</table>
81
+ </settings>
82
+ <color_map>
83
+ <table>configurablecolors_color_map</table>
84
+ </color_map>
85
+ </entities>
86
+ </configurablecolors_resource> -->
87
  </models>
88
+
89
+ <!-- <resources>
90
+ <configurablecolors_setup>
91
+ <setup>
92
+ <module>Grasshopperpebbles_Configurablecolors</module>
93
+ <class>Grasshopperpebbles_Configurablecolors_Model_Resource_Setup</class>
94
+ </setup>
95
+ </configurablecolors_setup>
96
+ </resources> -->
97
  <helpers>
98
  <configurablecolors>
99
  <class>Grasshopperpebbles_Configurablecolors_Helper</class>
107
  <thumb_height></thumb_height>
108
  <image_width>365</image_width>
109
  <image_height></image_height>
 
 
 
110
  </images>
111
+ <zoom_settings>
112
+ <show_zoom>1</show_zoom>
113
+ <zoom_position>inside</zoom_position>
114
+ <zoom_width>300</zoom_width>
115
+ <zoom_height>300</zoom_height>
116
+ <zoom_image_width>1000</zoom_image_width>
117
+ <zoom_image_height></zoom_image_height>
118
+ </zoom_settings>
119
  <color_options>
120
  <color_map></color_map>
121
  </color_options>
app/code/community/Grasshopperpebbles/Configurablecolors/etc/system.xml CHANGED
@@ -78,19 +78,40 @@
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>1</show_in_store>
80
  </image_height>
81
- <show_zoom translate="label">
 
 
 
 
 
 
 
 
 
 
82
  <label>Show Image Zoom</label>
83
  <frontend_type>select</frontend_type>
84
  <source_model>adminhtml/system_config_source_yesno</source_model>
85
- <sort_order>5</sort_order>
86
  <show_in_default>1</show_in_default>
87
  <show_in_website>1</show_in_website>
88
  <show_in_store>1</show_in_store>
89
  </show_zoom>
 
 
 
 
 
 
 
 
 
 
90
  <zoom_width translate="label">
91
  <label>Zoom Width</label>
 
92
  <frontend_type>text</frontend_type>
93
- <sort_order>6</sort_order>
94
  <show_in_default>1</show_in_default>
95
  <show_in_website>1</show_in_website>
96
  <show_in_store>1</show_in_store>
@@ -98,20 +119,40 @@
98
  </zoom_width>
99
  <zoom_height translate="label">
100
  <label>Zoom Height</label>
101
- <comment>If a height is not entered, it will be calculated based upon the width.</comment>
102
  <frontend_type>text</frontend_type>
103
- <sort_order>7</sort_order>
104
  <show_in_default>1</show_in_default>
105
  <show_in_website>1</show_in_website>
106
  <show_in_store>1</show_in_store>
107
  <depends><show_zoom>1</show_zoom></depends>
108
  </zoom_height>
109
- </fields>
110
- </images>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  <color_options translate="label">
112
  <label>Color Options</label>
113
  <frontend_type>text</frontend_type>
114
- <sort_order>2</sort_order>
115
  <show_in_default>1</show_in_default>
116
  <show_in_website>1</show_in_website>
117
  <show_in_store>1</show_in_store>
@@ -144,4 +185,4 @@
144
  </groups>
145
  </configurablecolors>
146
  </sections>
147
- </config>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>1</show_in_store>
80
  </image_height>
81
+ </fields>
82
+ </images>
83
+ <zoom_settings translate="label">
84
+ <label>Zoom Settings</label>
85
+ <frontend_type>text</frontend_type>
86
+ <sort_order>2</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ <fields>
91
+ <show_zoom translate="label">
92
  <label>Show Image Zoom</label>
93
  <frontend_type>select</frontend_type>
94
  <source_model>adminhtml/system_config_source_yesno</source_model>
95
+ <sort_order>1</sort_order>
96
  <show_in_default>1</show_in_default>
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
  </show_zoom>
100
+ <zoom_position translate="label">
101
+ <label>Zoom Position</label>
102
+ <frontend_type>select</frontend_type>
103
+ <source_model>configurablecolors_adminhtml/system_config_source_zoomposition</source_model>
104
+ <sort_order>2</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ <depends><show_zoom>1</show_zoom></depends>
109
+ </zoom_position>
110
  <zoom_width translate="label">
111
  <label>Zoom Width</label>
112
+ <comment>The width of the image container.</comment>
113
  <frontend_type>text</frontend_type>
114
+ <sort_order>3</sort_order>
115
  <show_in_default>1</show_in_default>
116
  <show_in_website>1</show_in_website>
117
  <show_in_store>1</show_in_store>
119
  </zoom_width>
120
  <zoom_height translate="label">
121
  <label>Zoom Height</label>
122
+ <comment>The height of the image container.</comment>
123
  <frontend_type>text</frontend_type>
124
+ <sort_order>4</sort_order>
125
  <show_in_default>1</show_in_default>
126
  <show_in_website>1</show_in_website>
127
  <show_in_store>1</show_in_store>
128
  <depends><show_zoom>1</show_zoom></depends>
129
  </zoom_height>
130
+ <zoom_image_width translate="label">
131
+ <label>Image Zoom Width</label>
132
+ <comment>The width of the image.</comment>
133
+ <frontend_type>text</frontend_type>
134
+ <sort_order>5</sort_order>
135
+ <show_in_default>1</show_in_default>
136
+ <show_in_website>1</show_in_website>
137
+ <show_in_store>1</show_in_store>
138
+ <depends><show_zoom>1</show_zoom></depends>
139
+ </zoom_image_width>
140
+ <zoom_image_height translate="label">
141
+ <label>Image Zoom Height</label>
142
+ <comment>The height of the image. If a height is not entered, it will be calculated based upon the width.</comment>
143
+ <frontend_type>text</frontend_type>
144
+ <sort_order>6</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>1</show_in_store>
148
+ <depends><show_zoom>1</show_zoom></depends>
149
+ </zoom_image_height>
150
+ </fields>
151
+ </zoom_settings>
152
  <color_options translate="label">
153
  <label>Color Options</label>
154
  <frontend_type>text</frontend_type>
155
+ <sort_order>3</sort_order>
156
  <show_in_default>1</show_in_default>
157
  <show_in_website>1</show_in_website>
158
  <show_in_store>1</show_in_store>
185
  </groups>
186
  </configurablecolors>
187
  </sections>
188
+ </config>
app/design/frontend/base/default/template/configurablecolors/settings.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $thumb_size = getConfigurableImageSizes('thumb');
3
  $large_size = getConfigurableImageSizes('image');
4
- $zoom_size = getConfigurableImageSizes('zoom');
5
 
6
  function getConfigurableImageSizes($size_type) {
7
  $size = Mage::getStoreConfig('configurablecolors/images/'. $size_type .'_width');
@@ -14,6 +14,7 @@ function getConfigurableImageSizes($size_type) {
14
 
15
  ?>
16
  <script type="text/javascript">
 
17
  jQuery(document).ready(function($) {
18
  var c_map = <?php echo Mage::getStoreConfig('configurablecolors/color_options/color_map'); ?>;
19
  c_map = c_map.color_map;
@@ -26,7 +27,10 @@ jQuery(document).ready(function($) {
26
  swatch_image_url: '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). "grasshopperpebbles_configurablecolors/"; ?>',
27
  thumb_size: '<?php echo $thumb_size; ?>',
28
  large_size: '<?php echo $large_size; ?>',
29
- zoom_size: '<?php echo $zoom_size; ?>',
 
 
 
30
  use_zoom: Boolean(<?php echo Mage::getStoreConfig('configurablecolors/images/show_zoom'); ?>),
31
  //hide_color_dropdown: true,
32
  color_map: c_map
1
  <?php
2
  $thumb_size = getConfigurableImageSizes('thumb');
3
  $large_size = getConfigurableImageSizes('image');
4
+ $zoom_size = getConfigurableImageSizes('zoom_image');
5
 
6
  function getConfigurableImageSizes($size_type) {
7
  $size = Mage::getStoreConfig('configurablecolors/images/'. $size_type .'_width');
14
 
15
  ?>
16
  <script type="text/javascript">
17
+ jQuery.noConflict();
18
  jQuery(document).ready(function($) {
19
  var c_map = <?php echo Mage::getStoreConfig('configurablecolors/color_options/color_map'); ?>;
20
  c_map = c_map.color_map;
27
  swatch_image_url: '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). "grasshopperpebbles_configurablecolors/"; ?>',
28
  thumb_size: '<?php echo $thumb_size; ?>',
29
  large_size: '<?php echo $large_size; ?>',
30
+ zoom_image_size: '<?php echo $zoom_size; ?>',
31
+ zoom_width: '<?php echo Mage::getStoreConfig('configurablecolors/zoom_settings/zoom_width'); ?>',
32
+ zoom_height: '<?php echo Mage::getStoreConfig('configurablecolors/zoom_settings/zoom_height'); ?>',
33
+ zoom_position: '<?php echo Mage::getStoreConfig('configurablecolors/zoom_settings/zoom_position'); ?>',
34
  use_zoom: Boolean(<?php echo Mage::getStoreConfig('configurablecolors/images/show_zoom'); ?>),
35
  //hide_color_dropdown: true,
36
  color_map: c_map
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Grasshopperpebbles_Configurablecolors</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>
@@ -14,14 +14,18 @@ The Configurable Colors extension also controls the display of the thumb and lar
14
  The Configurable Colors extension also comes with an image zoom component. The size of the zoom image is also configurable. </description>
15
  <notes>Stable&#xD;
16
  &#xD;
 
 
 
 
17
  Version number: 1.0.0&#xD;
18
  Stability: Stable&#xD;
19
  Compatibility: 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7&#xD;
20
  </notes>
21
  <authors><author><name>Les Green</name><user>lesgreen</user><email>lesgreen@grasshopperpebbles.com</email></author></authors>
22
- <date>2013-12-28</date>
23
- <time>13:55:08</time>
24
- <contents><target name="magecommunity"><dir name="Grasshopperpebbles"><dir name="Configurablecolors"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Colormap.php" hash="324bb5b9f058af0a7b7ed4fcf7ff277d"/></dir></dir></dir></dir></dir><file name="Settings.php" hash="9634c1ae39ebc33c4e81f12d47e4ceab"/></dir><dir name="Helper"><file name="Data.php" hash="4bc7051a030e42fef72ec56c76398c1f"/></dir><dir name="Model"><file name="Colormap.php" hash="789f595cc3c997c4b993a2a9ef7035ed"/><dir name="Resource"><file name="Setup.php" hash="97144fe5d6c87e4495c61ad0ef6a0c2c"/></dir></dir><dir name="controllers"><file name="ConfigurablecolorsController.php" hash="3da6cc0eb203a20047a2eb13f5a22202"/></dir><dir name="etc"><file name="config.xml" hash="153e6881ba37ad0f8fe654310330febf"/><file name="system.xml" hash="9a7f6050e9cfe200d2e1954ff28a151e"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="grasshopperpebbles_configurablecolors.xml" hash="68fb5f93bf72b1fd345ba0fdbff3c1f3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="grasshopperpebbles_configurablecolors.xml" hash="de9b1df2e20d0b828513c636244ca7aa"/></dir><dir name="template"><dir name="configurablecolors"><file name="settings.phtml" hash="cf8f9b7d537bd81b9b461093629821d1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Grasshopperpebbles_Configurablecolors.xml" hash="f1129be87d78650f72d6634d9e1b7786"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="grasshopperpebbles_configurablecolors"><file name="adminhtml.css" hash="375269b7ce63cf926dcfdee3eab64a6c"/><file name="adminhtml.js" hash="468dd113b9ea76ec0977781aced55fde"/><file name="jquery-1.7.1.min.js" hash="a582795ee2a7189a8b9f616685944e5e"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="grasshopperpebbles_configurablecolors"><file name="cloud-zoom.css" hash="c38ebaa2cece30139d7f120d719c079a"/><file name="grasshopperpebbles_configurablecolors.css" hash="a634c8b47b31c93f760ad69c3487a745"/></dir></dir><dir name="js"><dir name="gpconfigurablecolors"><file name="cloud-zoom.1.0.2.min.js" hash="e233d9a799550d0f58248d6eee669590"/><file name="jquery.gpConfigurableColors-min.js" hash="2af22426951218397aaef350bca033db"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><file name="jquery-1.7.1.min.js" hash=""/></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.2.0</min><max>5.5.7</max></php></required></dependencies>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Grasshopperpebbles_Configurablecolors</name>
4
+ <version>1.0.1</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>
14
  The Configurable Colors extension also comes with an image zoom component. The size of the zoom image is also configurable. </description>
15
  <notes>Stable&#xD;
16
  &#xD;
17
+ Version Number 1.0.1&#xD;
18
+ Updated Image Zoom Options&#xD;
19
+ Fixed jQuery noConflict bug in admin&#xD;
20
+ &#xD;
21
  Version number: 1.0.0&#xD;
22
  Stability: Stable&#xD;
23
  Compatibility: 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7&#xD;
24
  </notes>
25
  <authors><author><name>Les Green</name><user>lesgreen</user><email>lesgreen@grasshopperpebbles.com</email></author></authors>
26
+ <date>2014-01-01</date>
27
+ <time>21:53:56</time>
28
+ <contents><target name="magecommunity"><dir name="Grasshopperpebbles"><dir name="Configurablecolors"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Zoomposition.php" hash="2883febb17ca83736fa9456c935a10dc"/></dir></dir></dir></dir></dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Colormap.php" hash="324bb5b9f058af0a7b7ed4fcf7ff277d"/></dir></dir></dir></dir></dir><file name="Settings.php" hash="9634c1ae39ebc33c4e81f12d47e4ceab"/></dir><dir name="Helper"><file name="Data.php" hash="4bc7051a030e42fef72ec56c76398c1f"/></dir><dir name="Model"><file name="Colormap.php" hash="789f595cc3c997c4b993a2a9ef7035ed"/><dir name="Resource"><file name="Setup.php" hash="97144fe5d6c87e4495c61ad0ef6a0c2c"/></dir></dir><dir name="controllers"><file name="ConfigurablecolorsController.php" hash="3da6cc0eb203a20047a2eb13f5a22202"/></dir><dir name="etc"><file name="config.xml" hash="a1b09a52d65a473db760765af7a0b122"/><file name="system.xml" hash="e9802c30c3682d9f002fac0420b47652"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="grasshopperpebbles_configurablecolors.xml" hash="68fb5f93bf72b1fd345ba0fdbff3c1f3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="grasshopperpebbles_configurablecolors.xml" hash="de9b1df2e20d0b828513c636244ca7aa"/></dir><dir name="template"><dir name="configurablecolors"><file name="settings.phtml" hash="904d722a291a029bac5d8ff422834290"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Grasshopperpebbles_Configurablecolors.xml" hash="f1129be87d78650f72d6634d9e1b7786"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="grasshopperpebbles_configurablecolors"><file name="adminhtml.css" hash="a17f9528ed9dffe4af3d4551672467ba"/><file name="adminhtml.js" hash="3f467bf7d21d6b223520fcf337aa0617"/><file name="jquery-1.7.1.min.js" hash="a582795ee2a7189a8b9f616685944e5e"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="grasshopperpebbles_configurablecolors"><file name="cloud-zoom.css" hash="c38ebaa2cece30139d7f120d719c079a"/><file name="grasshopperpebbles_configurablecolors.css" hash="a634c8b47b31c93f760ad69c3487a745"/></dir></dir><dir name="js"><dir name="gpconfigurablecolors"><file name="cloud-zoom.1.0.2.min.js" hash="e233d9a799550d0f58248d6eee669590"/><file name="jquery.gpConfigurableColors-min.js" hash="a0dacf8252020062e4427a0730991751"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><file name="jquery-1.7.1.min.js" hash=""/></dir></dir></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.2.0</min><max>5.5.7</max></php></required></dependencies>
31
  </package>
skin/adminhtml/default/default/grasshopperpebbles_configurablecolors/adminhtml.css CHANGED
@@ -3,4 +3,4 @@
3
  #configurablecolors_color_options .form-list td.value select {width:180px;}
4
  #configurable-color-table {width:100%; margin-top:10px;}
5
  #configurable-color-table th {background-color:#6f8992; color:#fff;}
6
- /*#row_configurablecolors_color_options_color_map {display:none;}*/
3
  #configurablecolors_color_options .form-list td.value select {width:180px;}
4
  #configurable-color-table {width:100%; margin-top:10px;}
5
  #configurable-color-table th {background-color:#6f8992; color:#fff;}
6
+ #row_configurablecolors_color_options_color_map {display:none;}
skin/adminhtml/default/default/grasshopperpebbles_configurablecolors/adminhtml.js CHANGED
@@ -1,29 +1,32 @@
 
1
  jQuery(document).ready(function($) {
2
  var v, tr, row;
3
  $("#color_map").hide();
4
  v = $.parseJSON($("#configurablecolors_color_options_color_map").val());
5
  //v = {"color_map":[{"Color Name":"24","Color Type":"color_hex","Color Value":"#CCCCCC"}]};
6
- v = v.color_map;
7
- if (v != '') {
8
- $.each(v, function(i, itm) {
9
- tr = $("<tr></tr>");
10
- $("<td></td>").append(itm['color_name']).appendTo($(tr));
11
- $("<td></td>").append(itm['color_type']).appendTo($(tr));
12
- $("<td></td>").append(itm['color_value']).appendTo($(tr));
13
- $("<td></td>").append(
14
- $("<a></a>").attr("class", "configurable-color-row").html("Delete")).appendTo($(tr));
15
- $(tr).appendTo($('#configurable-color-table tbody'));
16
- });
17
- /*rows = v.split("~");
18
- $.each(rows, function(i, itm) {
19
- tr = $("<tr></tr>");
20
- row = $(itm).split(";");
21
- $.each(row, function(j, td) {
22
- $("<td></td>").append($(td)).appendTo($("tr"));
23
  $("<td></td>").append(
24
- $("<a></a>").attr({"id": "configurable-color-row-"+j, "class": "configurable-color-row"}).html("Delete")).appendTo($("tr"));
 
25
  });
26
- });*/
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  $(".configurable-color-row").click(function() {
1
+ jQuery.noConflict();
2
  jQuery(document).ready(function($) {
3
  var v, tr, row;
4
  $("#color_map").hide();
5
  v = $.parseJSON($("#configurablecolors_color_options_color_map").val());
6
  //v = {"color_map":[{"Color Name":"24","Color Type":"color_hex","Color Value":"#CCCCCC"}]};
7
+ if (v) {
8
+ v = v.color_map;
9
+ if (v != '') {
10
+ $.each(v, function(i, itm) {
11
+ tr = $("<tr></tr>");
12
+ $("<td></td>").append(itm['color_name']).appendTo($(tr));
13
+ $("<td></td>").append(itm['color_type']).appendTo($(tr));
14
+ $("<td></td>").append(itm['color_value']).appendTo($(tr));
 
 
 
 
 
 
 
 
 
15
  $("<td></td>").append(
16
+ $("<a></a>").attr("class", "configurable-color-row").html("Delete")).appendTo($(tr));
17
+ $(tr).appendTo($('#configurable-color-table tbody'));
18
  });
19
+ /*rows = v.split("~");
20
+ $.each(rows, function(i, itm) {
21
+ tr = $("<tr></tr>");
22
+ row = $(itm).split(";");
23
+ $.each(row, function(j, td) {
24
+ $("<td></td>").append($(td)).appendTo($("tr"));
25
+ $("<td></td>").append(
26
+ $("<a></a>").attr({"id": "configurable-color-row-"+j, "class": "configurable-color-row"}).html("Delete")).appendTo($("tr"));
27
+ });
28
+ });*/
29
+ }
30
  }
31
 
32
  $(".configurable-color-row").click(function() {
skin/frontend/default/default/js/gpconfigurablecolors/jquery.gpConfigurableColors-min.js CHANGED
@@ -1 +1 @@
1
- (function(e){e.fn.extend({gpConfigurableColors:function(t){opts=e.extend({},e.configurableColors.defaults,t);return this.each(function(){new e.configurableColors(this,opts)})}});e.configurableColors=function(t,n){function h(t){var r=e.parseJSON(t);u=r.hasGender==""?false:true;var i=p(r.items);i=d(0);var s=e("#"+n.swatch_container+" a")[0];g(e(s))}function p(t){var n=[];if(u){var r=[];e.each(t,function(n,i){if(r.indexOf(i.gender)==-1){r.push(i.gender);o[o.length]=e(t).filter(function(){return this.gender==i.gender})}})}else{var i=[];e.each(t,function(n,r){if(i.indexOf(r.item_size)==-1){i.push(r.item_size);o[o.length]=e(t).filter(function(){return this.item_size==r.item_size})}})}return true}function d(t){var r=n.color_map;var i,s,u,a,f;e.each(o[t],function(t,o){i=o.color_name;a=false;if(r.length>0){s=e(r).filter(function(){return this.color_name==o.color_name});if(s.length>0){if("color_hex"in s[0]){i=s[0]["color_hex"]}else if("color_class"in s[0]){a=true;f=s[0]["color_class"]}}}u=e("<a />").addClass(n.swatch_class);if(a){e(u).addClass(f)}else{e(u).css("background-color",i)}e(u).attr("title",o.color_name).appendTo(e("#"+n.swatch_container)).data("settings",{color_id:o.color_id,color:i,isClass:a,assoc_id:o.assoc_id,large_src:o.large_src,zoom_src:o.zoom_src,thumbs:o.thumbs}).click(function(){g(e(this))})});return true}function v(t){var n=spConfig.settings[s];e(n).val(t);var r=e(n).prop("selectedIndex");spConfig.settings[s].selectedIndex=r;var i=spConfig.settings[s];++s;Event.observe(i,"change",function(){});m(i,"change");if(u&&!a){a=true;setTimeout(function(){v(t)},1)}}function m(e,t){if(document.createEventObject){var n=document.createEventObject();return e.fireEvent("on"+t,n)}else{var n=document.createEvent("HTMLEvents");n.initEvent(t,true,true);return!e.dispatchEvent(n)}}function g(t){if(i){e(i).removeClass(n.swatch_class_selected)}i=t;var r=e(t).data("settings").isClass;if(!r){e(i).addClass(n.swatch_class_selected)}spConfig.reloadPrice();e(l).children("span").remove();e(l).append(e("<span></span>").html(" "+e(t).data("settings").color));if(n.use_zoom){e("p.product-image img").remove();e("p.product-image").append(e("<a></a>").attr({href:e(t).data("settings").zoom_src,"class":"cloud-zoom",id:"cloudZoom",rel:"zoomWidth: '300',zoomHeight: '300',position: 'right',smoothMove: 3,showTitle: true,titleOpacity: 0,lensOpacity: 0,tintOpacity: 0,softFocus: false"}).append(e("<img />").attr("src",e(t).data("settings").large_src)))}else{e("p.product-image img").attr("src",e(t).data("settings").large_src)}s=0;v(e(t).data("settings").color_id);y(t)}function y(t){var r,i;var s=e(t).data("settings").thumbs;e(".more-views ul").remove();var o=e("<ul></ul>").appendTo(".more-views");if(n.use_zoom){e.each(s,function(t,n){e(o).append(e("<li></li>").append(e("<a></a>").attr({rel:"useZoom: 'cloudZoom', smallImage: '"+n.large_src+"'",href:n.zoom_src}).addClass("cloud-zoom-gallery").append(e("<img />").attr("src",n.thumb_src))))});e(".cloud-zoom, .cloud-zoom-gallery").CloudZoom()}else{e.each(s,function(t,n){e(o).append(e("<li></li>").append(e("<a></a>").attr("href","#").append(e("<img />").attr("src",n.thumb_src)).click(function(){e("p.product-image img").attr("src",n.large_src)})))})}}function b(t,n,r,i,s,o){e.ajax({type:t,url:n,data:r,dataType:i,beforeSend:s,success:o,error:w})}function w(e,t,n){console.log(t)}function E(e){var t=0;for(elem in o){if(t==e){return elem}t++}}var r=e(t);var i="";var s=0;var o=[];var u=true;var a=false;var f=e("#attribute272").parent().parent();e("#"+n.swatch_container).appendTo(e(f));if(n.hide_color_dropdown){e("#attribute272").hide()}var l=e(f).siblings("dt")[0];if(n.assoc_products_url){var c={product_id:n.product_id,thumb_size:n.thumb_size,large_size:n.large_size,zoom_size:n.zoom_size};b("GET",n.assoc_products_url,c,"text","",h)}};e.configurableColors.defaults={product_id:"",sp_config:"",assoc_products_url:"",swatch_container:"",swatch_class:"",swatch_class_selected:"",hide_color_dropdown:false,thumb_size:"",large_size:"",zoom_size:"",use_zoom:true}})(jQuery)
1
+ (function(e){e.fn.extend({gpConfigurableColors:function(t){opts=e.extend({},e.configurableColors.defaults,t);return this.each(function(){new e.configurableColors(this,opts)})}});e.configurableColors=function(t,n){function h(t){var r=e.parseJSON(t);u=r.hasGender==""?false:true;var i=p(r.items);i=d(0);var s=e("#"+n.swatch_container+" a")[0];g(e(s))}function p(t){var n=[];if(u){var r=[];e.each(t,function(n,i){if(r.indexOf(i.gender)==-1){r.push(i.gender);o[o.length]=e(t).filter(function(){return this.gender==i.gender})}})}else{var i=[];e.each(t,function(n,r){if(i.indexOf(r.item_size)==-1){i.push(r.item_size);o[o.length]=e(t).filter(function(){return this.item_size==r.item_size})}})}return true}function d(t){var r=n.color_map;var i,s,u,a,f;e.each(o[t],function(t,o){i=o.color_name;a=false;u=e("<a />").addClass(n.swatch_class);if(r.length>0){s=e(r).filter(function(){return this.color_name==o.color_name});if(s.length>0){if("color_hex"in s[0]){e(u).css("background-color",s[0]["color_hex"])}else if("color_class"in s[0]){a=true;e(u).addClass(s[0]["color_class"])}else if("color_image"in s[0]){e(u).append(e("<img />").attr("src",n.swatch_image_url+s[0]["color_image"]))}}else{e(u).css("background-color",i)}}else{e(u).css("background-color",i)}e(u).attr("title",o.color_name).appendTo(e("#"+n.swatch_container)).data("settings",{color_id:o.color_id,color:i,isClass:a,assoc_id:o.assoc_id,large_src:o.large_src,zoom_src:o.zoom_src,thumbs:o.thumbs}).click(function(){g(e(this))})});return true}function v(t){var n=spConfig.settings[s];e(n).val(t);var r=e(n).prop("selectedIndex");spConfig.settings[s].selectedIndex=r;var i=spConfig.settings[s];++s;Event.observe(i,"change",function(){});m(i,"change");if(u&&!a){a=true;setTimeout(function(){v(t)},1)}}function m(e,t){if(document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent(t,true,true);return!e.dispatchEvent(n)}else{var n=document.createEventObject();return e.fireEvent("on"+t,n)}}function g(t){if(i){e(i).removeClass(n.swatch_class_selected)}i=t;var r=e(t).data("settings").isClass;if(!r){e(i).addClass(n.swatch_class_selected)}spConfig.reloadPrice();e(l).children("span").remove();e(l).append(e("<span></span>").html(" "+e(t).data("settings").color));if(n.use_zoom){e("p.product-image img").remove();e("p.product-image").append(e("<a></a>").attr({href:e(t).data("settings").zoom_src,"class":"cloud-zoom",id:"cloudZoom",rel:"zoomWidth: '"+n.zoom_width+"',zoomHeight: '"+n.zoom_height+"',position: '"+n.zoom_position+"',smoothMove: 3,showTitle: true,titleOpacity: 0,lensOpacity: 0,tintOpacity: 0,softFocus: false"}).append(e("<img />").attr("src",e(t).data("settings").large_src)))}else{e("p.product-image img").attr("src",e(t).data("settings").large_src)}s=0;v(e(t).data("settings").color_id);y(t)}function y(t){var r,i;var s=e(t).data("settings").thumbs;e(".more-views ul").remove();var o=e("<ul></ul>").appendTo(".more-views");if(n.use_zoom){e.each(s,function(t,n){e(o).append(e("<li></li>").append(e("<a></a>").attr({rel:"useZoom: 'cloudZoom', smallImage: '"+n.large_src+"'",href:n.zoom_src}).addClass("cloud-zoom-gallery").append(e("<img />").attr("src",n.thumb_src))))});e(".cloud-zoom, .cloud-zoom-gallery").CloudZoom()}else{e.each(s,function(t,n){e(o).append(e("<li></li>").append(e("<a></a>").attr("href","#").append(e("<img />").attr("src",n.thumb_src)).click(function(){e("p.product-image img").attr("src",n.large_src)})))})}}function b(t,n,r,i,s,o){e.ajax({type:t,url:n,data:r,dataType:i,beforeSend:s,success:o,error:w})}function w(e,t,n){console.log(t)}function E(e){var t=0;for(elem in o){if(t==e){return elem}t++}}var r=e(t);var i="";var s=0;var o=[];var u=true;var a=false;var f=e("#attribute272").parent().parent();e("#"+n.swatch_container).appendTo(e(f));if(n.hide_color_dropdown){e("#attribute272").hide()}var l=e(f).siblings("dt")[0];if(n.assoc_products_url){var c={product_id:n.product_id,thumb_size:n.thumb_size,large_size:n.large_size,zoom_size:n.zoom_image_size};b("GET",n.assoc_products_url,c,"text","",h)}};e.configurableColors.defaults={product_id:"",sp_config:"",assoc_products_url:"",swatch_container:"",swatch_class:"",swatch_class_selected:"",hide_color_dropdown:true,swatch_image_url:"",thumb_size:"",large_size:"",zoom_image_size:"",zoom_width:"",zoom_height:"",zoom_position:"",use_zoom:true}})(jQuery)