Cybage_Swatches - Version 1.1.0

Version Notes

After installation of the Color Swatches plug-in, please clear the cache.

Download this release

Release Info

Developer Cybage Software Pvt. Ltd.
Extension Cybage_Swatches
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.1 to 1.1.0

app/code/community/Cybage/Swatches/Block/Adminhtml/Catalog/Product/Attribute/Edit/Tab/Main.php CHANGED
@@ -37,9 +37,6 @@ class Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Main ex
37
  $fieldset = $form->addFieldset('swatches_fieldset',
38
  array('legend'=>Mage::helper('eav')->__('Swatches Properties'))
39
  );
40
-
41
-
42
- //$fieldset = $form->getElement('base_fieldset');
43
  $fieldset->addField(
44
  'useSwatches', 'select', array(
45
  'name' => 'useSwatches',
37
  $fieldset = $form->addFieldset('swatches_fieldset',
38
  array('legend'=>Mage::helper('eav')->__('Swatches Properties'))
39
  );
 
 
 
40
  $fieldset->addField(
41
  'useSwatches', 'select', array(
42
  'name' => 'useSwatches',
app/code/community/Cybage/Swatches/Block/Catalog/Product/View/Type/Configurable.php CHANGED
@@ -21,12 +21,15 @@
21
  class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Type_Configurable
22
  {
23
  protected $childProducts;
 
 
 
24
 
25
  protected function _afterToHtml($html) {
26
  $attributeIdsWithImages = Mage::registry('swatches_allowed_ids');
27
  $confData = array();
28
  $html = parent::_afterToHtml($html);
29
- if ('product.info.options.configurable' == $this->getNameInLayout() && Mage::getStoreConfig('swatches/default/show_swatches')) {
30
  if (!empty($attributeIdsWithImages)) {
31
  foreach ($attributeIdsWithImages as $attrIdToHide) {
32
  $html = preg_replace('@(id="attribute' . $attrIdToHide . ')(-)?([0-9]*)(")(\s+)(class=")(.*?)(super-attribute-select)(-)?([0-9]*)@', '$1$2$3$4$5$6$7$8$9$10 no-display', $html);
@@ -36,10 +39,10 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_
36
 
37
  if ($this->childProducts) {
38
  $this->childProducts = array_values($this->childProducts);
39
-
40
  foreach ($simpleProducts as $simple) {
41
  $key = array();
42
- for ($i = 0; $i < count($this->childProducts); $i++) {
43
  foreach ($this->childProducts[$i] as $optionId => $productIds) {
44
  if (in_array($simple->getId(), $productIds)) {
45
  $key[] = $optionId;
@@ -61,8 +64,8 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_
61
  $confData[$strKey]['media_url'][$i]['url'] = Mage::helper('catalog/output')->productAttribute($simple, Mage::helper('catalog/image')->init($simple, 'image')->resize(265), 'image')->__toString();
62
  $confData[$strKey]['media_url'][$i]['galleryUrl'] = Mage::helper('catalog/image')->init($simple, 'image');
63
  }
64
-
65
- if(count($imgGallery) > 0) {
66
  foreach ($imgGallery as $_image) {
67
  ++$i;
68
  $params = array('id' => $simple->getId(), 'image' => $_image->getValueId());
@@ -76,26 +79,22 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_
76
  $confData[$strKey]['media_url'][1]['url'] = '';
77
  $confData[$strKey]['media_url'][1]['galleryUrl'] = '';
78
  }
79
-
80
  }
81
  }
82
  }
83
  $html .= '<script type="text/javascript"> additionalData = new PDPSwatchesData(' . Zend_Json::encode($confData) . '); </script>';
84
  }
85
  }
86
-
87
  return $html;
88
  }
89
-
90
  public function getJsonConfig() {
91
-
92
  $jsonConfig = parent::getJsonConfig();
93
  $config = Zend_Json::decode($jsonConfig);
94
  $swatchesIds = array();
95
  if (Mage::getStoreConfig('swatches/default/show_swatches')) {
96
  foreach ($config['attributes'] as $attributeId => $attribute) {
97
  $attrSwatches = Mage::getModel('swatches/attribute')->load($attributeId, 'attribute_id');
98
-
99
  if ($attrSwatches->getUseSwatches()) {
100
  $config['attributes'][$attributeId]['swatches_size'] = Mage::helper('swatches')->getOptionsImageSizePDP();
101
  $config['attributes'][$attributeId]['use_swatches'] = 1;
@@ -111,4 +110,4 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_
111
  }
112
  return Zend_Json::encode($config);
113
  }
114
- }
21
  class Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Type_Configurable
22
  {
23
  protected $childProducts;
24
+ const LAYOUT_NAME = 'product.info.options.configurable';
25
+
26
+ /* return html data */
27
 
28
  protected function _afterToHtml($html) {
29
  $attributeIdsWithImages = Mage::registry('swatches_allowed_ids');
30
  $confData = array();
31
  $html = parent::_afterToHtml($html);
32
+ if ($this->getNameInLayout()== Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable::LAYOUT_NAME && Mage::getStoreConfig('swatches/default/show_swatches')) {
33
  if (!empty($attributeIdsWithImages)) {
34
  foreach ($attributeIdsWithImages as $attrIdToHide) {
35
  $html = preg_replace('@(id="attribute' . $attrIdToHide . ')(-)?([0-9]*)(")(\s+)(class=")(.*?)(super-attribute-select)(-)?([0-9]*)@', '$1$2$3$4$5$6$7$8$9$10 no-display', $html);
39
 
40
  if ($this->childProducts) {
41
  $this->childProducts = array_values($this->childProducts);
42
+ $childProductCount = count($this->childProducts);
43
  foreach ($simpleProducts as $simple) {
44
  $key = array();
45
+ for ($i = 0; $i < $childProductCount; $i++) {
46
  foreach ($this->childProducts[$i] as $optionId => $productIds) {
47
  if (in_array($simple->getId(), $productIds)) {
48
  $key[] = $optionId;
64
  $confData[$strKey]['media_url'][$i]['url'] = Mage::helper('catalog/output')->productAttribute($simple, Mage::helper('catalog/image')->init($simple, 'image')->resize(265), 'image')->__toString();
65
  $confData[$strKey]['media_url'][$i]['galleryUrl'] = Mage::helper('catalog/image')->init($simple, 'image');
66
  }
67
+ $countImgGallary = count($imgGallery);
68
+ if($countImgGallary > 0) {
69
  foreach ($imgGallery as $_image) {
70
  ++$i;
71
  $params = array('id' => $simple->getId(), 'image' => $_image->getValueId());
79
  $confData[$strKey]['media_url'][1]['url'] = '';
80
  $confData[$strKey]['media_url'][1]['galleryUrl'] = '';
81
  }
 
82
  }
83
  }
84
  }
85
  $html .= '<script type="text/javascript"> additionalData = new PDPSwatchesData(' . Zend_Json::encode($confData) . '); </script>';
86
  }
87
  }
 
88
  return $html;
89
  }
90
+ /* return json*/
91
  public function getJsonConfig() {
 
92
  $jsonConfig = parent::getJsonConfig();
93
  $config = Zend_Json::decode($jsonConfig);
94
  $swatchesIds = array();
95
  if (Mage::getStoreConfig('swatches/default/show_swatches')) {
96
  foreach ($config['attributes'] as $attributeId => $attribute) {
97
  $attrSwatches = Mage::getModel('swatches/attribute')->load($attributeId, 'attribute_id');
 
98
  if ($attrSwatches->getUseSwatches()) {
99
  $config['attributes'][$attributeId]['swatches_size'] = Mage::helper('swatches')->getOptionsImageSizePDP();
100
  $config['attributes'][$attributeId]['use_swatches'] = 1;
110
  }
111
  return Zend_Json::encode($config);
112
  }
113
+ }
app/code/community/Cybage/Swatches/Block/Catalog/Product/View/Type/ConfigurableList.php CHANGED
@@ -23,6 +23,7 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList extends M
23
  protected $_optionProducts;
24
  protected $_jsonConfig;
25
 
 
26
  public function checkConfAttribute()
27
  {
28
  $configAttributes = $this->getAllowAttributes();
@@ -36,6 +37,7 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList extends M
36
  return $attributeInfoArray;
37
  }
38
 
 
39
  protected function _afterToHtml($html)
40
  {
41
 
@@ -49,10 +51,12 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList extends M
49
  if ($this->_optionProducts)
50
  {
51
  $this->_optionProducts = array_values($this->_optionProducts);
 
52
  foreach ($simpleProducts as $simple)
53
  {
54
  $key = array();
55
- for ($i = 0; $i < count($this->_optionProducts); $i++)
 
56
  {
57
  foreach ($this->_optionProducts[$i] as $optionId => $productIds)
58
  {
@@ -80,6 +84,7 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList extends M
80
 
81
  return $html;
82
  }
 
83
 
84
  public function getJsonConfig()
85
  {
@@ -105,6 +110,7 @@ class Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList extends M
105
  return Zend_Json::encode($config);
106
  }
107
 
 
108
  public function getPriceForConfig()
109
  {
110
  $config = array();
23
  protected $_optionProducts;
24
  protected $_jsonConfig;
25
 
26
+ /* return attribute info */
27
  public function checkConfAttribute()
28
  {
29
  $configAttributes = $this->getAllowAttributes();
37
  return $attributeInfoArray;
38
  }
39
 
40
+ /* return htm data */
41
  protected function _afterToHtml($html)
42
  {
43
 
51
  if ($this->_optionProducts)
52
  {
53
  $this->_optionProducts = array_values($this->_optionProducts);
54
+ $countOptionProducts = count($this->_optionProducts);
55
  foreach ($simpleProducts as $simple)
56
  {
57
  $key = array();
58
+
59
+ for ($i = 0; $i < $countOptionProducts ; $i++)
60
  {
61
  foreach ($this->_optionProducts[$i] as $optionId => $productIds)
62
  {
84
 
85
  return $html;
86
  }
87
+ /* return json*/
88
 
89
  public function getJsonConfig()
90
  {
110
  return Zend_Json::encode($config);
111
  }
112
 
113
+ /* return json data of product price*/
114
  public function getPriceForConfig()
115
  {
116
  $config = array();
app/code/community/Cybage/Swatches/Helper/Data.php CHANGED
@@ -20,10 +20,15 @@
20
 
21
  class Cybage_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
22
  {
 
 
 
 
 
 
23
  public function getUploadedImageUrl($attrValue)
24
  {
25
- $uploadDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .
26
- 'swatches' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
27
 
28
  if (file_exists($uploadDir . $attrValue . '.jpg'))
29
  {
@@ -32,13 +37,12 @@ class Cybage_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
32
  return '';
33
  }
34
 
 
 
35
  public function getSwatchesBlock($_product, $html)
36
  {
37
- $block = Mage::app()->getLayout()->createBlock(
38
- 'Cybage_Swatches_Block_Catalog_Product_View_Type_ConfigurableList',
39
- 'swatches_catalog_product_view_type_configurable_list',
40
- array('template' => 'cybage/swatches/configurable.phtml')
41
- );
42
  $block->setProduct($_product);
43
  $block->setNameInLayout('product.info.options.configurable');
44
 
@@ -46,34 +50,37 @@ class Cybage_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
46
 
47
  return $html;
48
  }
49
-
50
- public function getthumbImageSize()
51
  {
52
  return Mage::getStoreConfig('swatches/list/thumb_img_size_list');
53
  }
54
-
 
55
  public function getOptionsImageSize()
56
  {
57
  return Mage::getStoreConfig('swatches/list/img_size_list');
58
  }
59
 
 
 
60
  public function getOptionsImageSizePDP()
61
  {
62
  return Mage::getStoreConfig('swatches/pdp/img_size_pdp');
63
  }
64
 
 
65
  public function getUseSwatches($attributeId)
66
  {
67
  $confAttr = Mage::getModel('swatches/attribute')->load($attributeId, 'attribute_id');
68
  return array($confAttr->getUseSwatches());
69
  }
70
-
71
  public function getProductImageUrl($productId,$optionId)
72
  {
73
  $attrValue = $productId."-".$optionId;
74
 
75
- $uploadDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .
76
- 'swatches' . DIRECTORY_SEPARATOR . 'products' . DIRECTORY_SEPARATOR;
77
 
78
  if (file_exists($uploadDir . $attrValue . '.jpg'))
79
  {
@@ -81,7 +88,7 @@ class Cybage_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
81
  }
82
  return '';
83
  }
84
-
85
  public function getSwatchesBasedOnPriority($attrValue,$productId)
86
  {
87
  $productLevelSwatches = $this->getProductImageUrl($productId,$attrValue);
20
 
21
  class Cybage_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
22
  {
23
+ /* @return path of swatch image */
24
+ public function getSwatchImageDir()
25
+ {
26
+ return Mage::getBaseDir('media') . DIRECTORY_SEPARATOR . 'swatches' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
27
+ }
28
+ /* @return URl of images */
29
  public function getUploadedImageUrl($attrValue)
30
  {
31
+ $uploadDir = $this->getSwatchImageDir();
 
32
 
33
  if (file_exists($uploadDir . $attrValue . '.jpg'))
34
  {
37
  return '';
38
  }
39
 
40
+ /* returns the swatch block html */
41
+
42
  public function getSwatchesBlock($_product, $html)
43
  {
44
+ $block = Mage::app()->getLayout()->createBlock('swatches/catalog_product_view_type_configurableList');
45
+ $block->setTemplate('cybage/swatches/configurable.phtml');
 
 
 
46
  $block->setProduct($_product);
47
  $block->setNameInLayout('product.info.options.configurable');
48
 
50
 
51
  return $html;
52
  }
53
+ /* return the Thumbimage size */
54
+ public function getthumbImageSize()
55
  {
56
  return Mage::getStoreConfig('swatches/list/thumb_img_size_list');
57
  }
58
+
59
+ /* return the size of options */
60
  public function getOptionsImageSize()
61
  {
62
  return Mage::getStoreConfig('swatches/list/img_size_list');
63
  }
64
 
65
+ /* return the size of swatch on view page */
66
+
67
  public function getOptionsImageSizePDP()
68
  {
69
  return Mage::getStoreConfig('swatches/pdp/img_size_pdp');
70
  }
71
 
72
+ /* return array */
73
  public function getUseSwatches($attributeId)
74
  {
75
  $confAttr = Mage::getModel('swatches/attribute')->load($attributeId, 'attribute_id');
76
  return array($confAttr->getUseSwatches());
77
  }
78
+ /* return the imageUrl of product */
79
  public function getProductImageUrl($productId,$optionId)
80
  {
81
  $attrValue = $productId."-".$optionId;
82
 
83
+ $uploadDir = $this->getSwatchImageDir();
 
84
 
85
  if (file_exists($uploadDir . $attrValue . '.jpg'))
86
  {
88
  }
89
  return '';
90
  }
91
+ /* return the swatches based on priority */
92
  public function getSwatchesBasedOnPriority($attrValue,$productId)
93
  {
94
  $productLevelSwatches = $this->getProductImageUrl($productId,$attrValue);
app/code/community/Cybage/Swatches/Helper/Product.php CHANGED
@@ -42,7 +42,7 @@ class Cybage_Swatches_Helper_Product extends Mage_Catalog_Helper_Product
42
 
43
  if(!$product->isVisibleInCatalog() || !$product->isVisibleInSiteVisibility()){
44
  $productType = $this->getProductInfo($product->getId());
45
- if($productType == "configurable"){
46
  return true;
47
  }
48
  }
42
 
43
  if(!$product->isVisibleInCatalog() || !$product->isVisibleInSiteVisibility()){
44
  $productType = $this->getProductInfo($product->getId());
45
+ if($productType == Mage_Catalog_Model_Product_Type_Configurable:: TYPE_CODE){
46
  return true;
47
  }
48
  }
app/code/community/Cybage/Swatches/Model/Observer.php CHANGED
@@ -20,14 +20,15 @@
20
 
21
  class Cybage_Swatches_Model_Observer
22
  {
 
 
23
  public function saveAttributesAfter($observer){
24
 
25
  $data = $observer->getControllerAction()->getRequest()->getPost();
26
 
27
  if($data['is_configurable'] && $data['is_global']){
28
 
29
- $baseDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .
30
- 'swatches' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
31
 
32
  if (isset($_FILES['swatches_img']) && isset($_FILES['swatches_img']['error']))
33
  {
@@ -36,10 +37,25 @@ class Cybage_Swatches_Model_Observer
36
  if ($errorCode == UPLOAD_ERR_OK)
37
  {
38
  if (strpos($optionId, 'option') === false) {
39
- move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $optionId . '.jpg');
40
- } else {
41
- $newOptionId = Mage::getResourceHelper('importexport')->getNextAutoincrement(Mage::getSingleton ( 'core/resource' )->getTableName('eav/attribute_option'))-1;
42
- move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $newOptionId . '.jpg');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  }
45
  }
@@ -55,28 +71,30 @@ class Cybage_Swatches_Model_Observer
55
  $confAttr->setUseSwatches(intval(Mage::app()->getRequest()->getPost('useSwatches')));
56
  $confAttr->save();
57
  }
58
-
59
- // $deleteArr = $data['swatches_img_delete'];
60
  if(isset($data['swatches_img_delete']) && !empty( $data['swatches_img_delete']))
61
  {
62
  foreach( $data['swatches_img_delete'] as $optionId => $value)
63
  {
64
  if ($value)
65
  {
66
- unlink($baseDir . $optionId . '.jpg');
 
 
 
 
67
  }
68
  }
69
  }
70
  }
71
  }
72
 
 
 
73
  public function onListBlockHtmlBefore($observer)
74
  {
75
  $block = $observer->getBlock();
76
  $transport = $observer->getTransport();
77
  $html = $transport->getHtml();
78
- //$thisClass = get_class($block);
79
-
80
  if (($block instanceof Mage_Catalog_Block_Product_List) && Mage::getStoreConfig('swatches/list/swatches_on_list')) {
81
 
82
  $collection = null;
@@ -91,12 +109,13 @@ class Cybage_Swatches_Model_Observer
91
  foreach ($collection->getItems() as $item) {
92
  $productsIdList[] = $item->getEntityId();
93
  }
94
-
95
- foreach($productsIdList as $value => $productId){
96
- $product = Mage::getModel('catalog/product')->load($productId);
97
-
 
98
  if($product->isSaleable() && $product->isConfigurable()){
99
- $template = '@(product-price-'.$productId.'">(.*?)div>)@s';
100
  preg_match_all($template, $html, $res);
101
  if($res[0]){
102
  $replace = Mage::helper('swatches')->getSwatchesBlock($product, $res[1][0]);
@@ -110,14 +129,15 @@ class Cybage_Swatches_Model_Observer
110
  }
111
  }
112
 
 
 
113
  public function saveCatalogProductAfter($observer){
114
 
115
  $deleteArr = Mage::app()->getRequest()->getPost('swatches_img_delete');
116
 
117
  $productId = $observer->getProduct()->getData('entity_id');
118
 
119
- $baseDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .
120
- 'swatches' . DIRECTORY_SEPARATOR . 'products' . DIRECTORY_SEPARATOR;
121
 
122
  if (isset($_FILES['swatches_img']) && isset($_FILES['swatches_img']['error']))
123
  {
@@ -125,18 +145,28 @@ class Cybage_Swatches_Model_Observer
125
  {
126
  if ($errorCode == UPLOAD_ERR_OK)
127
  {
 
128
  move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $productId.'-'.$optionId . '.jpg');
 
 
 
 
 
129
  }
130
  }
131
  }
132
-
133
  if(!empty($deleteArr))
134
  {
135
  foreach($deleteArr as $optionId => $value)
136
  {
137
  if ($value)
138
  {
139
- unlink($baseDir . $productId.'-'.$optionId . '.jpg');
 
 
 
 
 
140
  }
141
  }
142
  }
20
 
21
  class Cybage_Swatches_Model_Observer
22
  {
23
+ /* uploads the swatche image from options*/
24
+
25
  public function saveAttributesAfter($observer){
26
 
27
  $data = $observer->getControllerAction()->getRequest()->getPost();
28
 
29
  if($data['is_configurable'] && $data['is_global']){
30
 
31
+ $baseDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .'swatches' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
 
32
 
33
  if (isset($_FILES['swatches_img']) && isset($_FILES['swatches_img']['error']))
34
  {
37
  if ($errorCode == UPLOAD_ERR_OK)
38
  {
39
  if (strpos($optionId, 'option') === false) {
40
+ try
41
+ {
42
+ move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $optionId . '.jpg');
43
+ }
44
+ catch (Exception $e)
45
+ {
46
+ echo $e->getMessage();
47
+ }
48
+ }
49
+ else {
50
+ $newOptionId = Mage::getResourceHelper('importexport')->getNextAutoincrement(Mage::getSingleton ( 'core/resource' )->getTableName('eav/attribute_option'))-1;
51
+ try
52
+ {
53
+ move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $newOptionId . '.jpg');
54
+ }
55
+ catch (Exception $e)
56
+ {
57
+ echo $e->getMessage();
58
+ }
59
  }
60
  }
61
  }
71
  $confAttr->setUseSwatches(intval(Mage::app()->getRequest()->getPost('useSwatches')));
72
  $confAttr->save();
73
  }
 
 
74
  if(isset($data['swatches_img_delete']) && !empty( $data['swatches_img_delete']))
75
  {
76
  foreach( $data['swatches_img_delete'] as $optionId => $value)
77
  {
78
  if ($value)
79
  {
80
+ $filepath = $baseDir . $optionId . '.jpg';
81
+ if(file_exists($filepath))
82
+ {
83
+ unlink($baseDir . $optionId . '.jpg');
84
+ }
85
  }
86
  }
87
  }
88
  }
89
  }
90
 
91
+ /* @return list page swatches */
92
+
93
  public function onListBlockHtmlBefore($observer)
94
  {
95
  $block = $observer->getBlock();
96
  $transport = $observer->getTransport();
97
  $html = $transport->getHtml();
 
 
98
  if (($block instanceof Mage_Catalog_Block_Product_List) && Mage::getStoreConfig('swatches/list/swatches_on_list')) {
99
 
100
  $collection = null;
109
  foreach ($collection->getItems() as $item) {
110
  $productsIdList[] = $item->getEntityId();
111
  }
112
+ $collectionProduct = Mage::getResourceModel('catalog/product_collection')
113
+ ->addFieldToFilter('entity_id', $productsIdList)
114
+ ->addAttributeToSelect('*');
115
+
116
+ foreach($collectionProduct as $product){
117
  if($product->isSaleable() && $product->isConfigurable()){
118
+ $template = '@(product-price-'.$product->getId().'">(.*?)div>)@s';
119
  preg_match_all($template, $html, $res);
120
  if($res[0]){
121
  $replace = Mage::helper('swatches')->getSwatchesBlock($product, $res[1][0]);
129
  }
130
  }
131
 
132
+ /* assign swatches to product after the save event of catalog product*/
133
+
134
  public function saveCatalogProductAfter($observer){
135
 
136
  $deleteArr = Mage::app()->getRequest()->getPost('swatches_img_delete');
137
 
138
  $productId = $observer->getProduct()->getData('entity_id');
139
 
140
+ $baseDir = Mage::getBaseDir('media') . DIRECTORY_SEPARATOR .'swatches' . DIRECTORY_SEPARATOR . 'products' . DIRECTORY_SEPARATOR;
 
141
 
142
  if (isset($_FILES['swatches_img']) && isset($_FILES['swatches_img']['error']))
143
  {
145
  {
146
  if ($errorCode == UPLOAD_ERR_OK)
147
  {
148
+ try{
149
  move_uploaded_file($_FILES['swatches_img']['tmp_name'][$optionId], $baseDir . $productId.'-'.$optionId . '.jpg');
150
+ }
151
+ catch ( Exception $e)
152
+ {
153
+ echo $e->getMessage();
154
+ }
155
  }
156
  }
157
  }
 
158
  if(!empty($deleteArr))
159
  {
160
  foreach($deleteArr as $optionId => $value)
161
  {
162
  if ($value)
163
  {
164
+ $filepath = $baseDir . $productId.'-'.$optionId . '.jpg';
165
+ if(file_exists($filepath))
166
+ {
167
+ unlink($baseDir . $productId.'-'.$optionId . '.jpg');
168
+ }
169
+
170
  }
171
  }
172
  }
app/code/community/Cybage/Swatches/Model/{Mysql4 → Resource}/Attribute.php RENAMED
@@ -18,7 +18,7 @@
18
  * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
  */
20
 
21
- class Cybage_Swatches_Model_Mysql4_Attribute extends Mage_Core_Model_Mysql4_Abstract
22
  {
23
  protected function _construct()
24
  {
18
  * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
  */
20
 
21
+ class Cybage_Swatches_Model_Resource_Attribute extends Mage_Core_Model_Resource_Db_Abstract
22
  {
23
  protected function _construct()
24
  {
app/code/community/Cybage/Swatches/Model/{Mysql4 → Resource}/Attribute/Collection.php RENAMED
@@ -18,7 +18,7 @@
18
  * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
  */
20
 
21
- class Cybage_Swatches_Model_Mysql4_Attribute_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
22
  {
23
  protected function _construct()
24
  {
18
  * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
  */
20
 
21
+ class Cybage_Swatches_Model_Resource_Attribute_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
22
  {
23
  protected function _construct()
24
  {
app/code/community/Cybage/Swatches/etc/config.xml CHANGED
@@ -1,150 +1,148 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- /**
4
- * Cybage Color Swatches Plugin
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is available on the World Wide Web at:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you are unable to access it on the World Wide Web, please send an email
12
- * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
- *
14
- * @category Color Swatches Plugin
15
- * @package Cybage_Swatches
16
- * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
- * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
- */
21
- -->
22
- <config>
23
- <modules>
24
- <Cybage_Swatches>
25
- <version>1.0.0</version>
26
- </Cybage_Swatches>
27
- </modules>
28
- <frontend>
29
- <routers>
30
- <swatches>
31
- <use>standard</use>
32
- <args>
33
- <module>Cybage_Swatches</module>
34
- <frontName>swatches</frontName>
35
- </args>
36
- </swatches>
37
- </routers>
38
- <layout>
39
- <updates>
40
- <swatches>
41
- <file>cybage_swatches.xml</file>
42
- </swatches>
43
- </updates>
44
- </layout>
45
- </frontend>
46
- <adminhtml>
47
- <layout>
48
- <updates>
49
- <swatches>
50
- <file>cybage_swatches.xml</file>
51
- </swatches>
52
- </updates>
53
- </layout>
54
- </adminhtml>
55
- <global>
56
- <blocks>
57
- <swatches>
58
- <class>Cybage_Swatches_Block</class>
59
- </swatches>
60
- <!--<adminhtml>
61
- <rewrite>
62
- <catalog_product_attribute_edit_tabs>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tabs</catalog_product_attribute_edit_tabs>
63
- </rewrite>
64
- </adminhtml>-->
65
- <adminhtml>
66
- <rewrite>
67
- <catalog_product_attribute_edit_tab_main>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Main</catalog_product_attribute_edit_tab_main>
68
- <catalog_product_attribute_edit_tab_options>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Options</catalog_product_attribute_edit_tab_options>
69
- <catalog_product_attribute_edit_form>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Form</catalog_product_attribute_edit_form>
70
- <catalog_product_edit_tab_super_config_grid_renderer_checkbox>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Super_Config_Grid_Renderer</catalog_product_edit_tab_super_config_grid_renderer_checkbox>
71
- </rewrite>
72
- </adminhtml>
73
- <catalog>
74
- <rewrite>
75
- <product_view_type_configurable>Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable</product_view_type_configurable>
76
- </rewrite>
77
- </catalog>
78
- </blocks>
79
- <helpers>
80
- <swatches>
81
- <class>Cybage_Swatches_Helper</class>
82
- </swatches>
83
- <catalog>
84
- <rewrite>
85
- <product>Cybage_Swatches_Helper_Product</product>
86
- </rewrite>
87
- </catalog>
88
- </helpers>
89
- <models>
90
- <swatches>
91
- <class>Cybage_Swatches_Model</class>
92
- <resourceModel>swatches_mysql4</resourceModel>
93
- </swatches>
94
- <swatches_mysql4>
95
- <class>Cybage_Swatches_Model_Mysql4</class>
96
- <entities>
97
- <attribute>
98
- <table>cybage_swatches_attribute</table>
99
- </attribute>
100
- </entities>
101
- </swatches_mysql4>
102
- </models>
103
-
104
- <resources>
105
- <swatches_read>
106
- <connection><use>core_read</use></connection>
107
- </swatches_read>
108
- <swatches_write>
109
- <connection><use>core_write</use></connection>
110
- </swatches_write>
111
- <swatches_setup>
112
- <setup>
113
- <module>Cybage_Swatches</module>
114
- </setup>
115
- <connection>
116
- <use>core_setup</use>
117
- </connection>
118
- </swatches_setup>
119
- </resources>
120
- <events>
121
- <controller_action_postdispatch_adminhtml_catalog_product_attribute_save>
122
- <observers>
123
- <swatches_save_observer>
124
- <type>singleton</type>
125
- <class>swatches/observer</class>
126
- <method>saveAttributesAfter</method>
127
- </swatches_save_observer>
128
- </observers>
129
- </controller_action_postdispatch_adminhtml_catalog_product_attribute_save>
130
- <catalog_product_save_before>
131
- <observers>
132
- <swatches_on_product_save>
133
- <type>singleton</type>
134
- <class>swatches/observer</class>
135
- <method>saveCatalogProductAfter</method>
136
- </swatches_on_product_save>
137
- </observers>
138
- </catalog_product_save_before>
139
- <core_block_abstract_to_html_after>
140
- <observers>
141
- <swatches_onlist>
142
- <type>singleton</type>
143
- <class>swatches/observer</class>
144
- <method>onListBlockHtmlBefore</method>
145
- </swatches_onlist>
146
- </observers>
147
- </core_block_abstract_to_html_after>
148
- </events>
149
- </global>
150
- </config>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Cybage Color Swatches Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Color Swatches Plugin
15
+ * @package Cybage_Swatches
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Cybage_Swatches>
25
+ <version>1.0.0</version>
26
+ </Cybage_Swatches>
27
+ </modules>
28
+ <frontend>
29
+ <routers>
30
+ <swatches>
31
+ <use>standard</use>
32
+ <args>
33
+ <module>Cybage_Swatches</module>
34
+ <frontName>swatches</frontName>
35
+ </args>
36
+ </swatches>
37
+ </routers>
38
+ <layout>
39
+ <updates>
40
+ <swatches>
41
+ <file>cybage_swatches.xml</file>
42
+ </swatches>
43
+ </updates>
44
+ </layout>
45
+ <events>
46
+ <core_block_abstract_to_html_after>
47
+ <observers>
48
+ <swatches_onlist>
49
+ <type>singleton</type>
50
+ <class>swatches/observer</class>
51
+ <method>onListBlockHtmlBefore</method>
52
+ </swatches_onlist>
53
+ </observers>
54
+ </core_block_abstract_to_html_after>
55
+ </events>
56
+ </frontend>
57
+ <adminhtml>
58
+ <layout>
59
+ <updates>
60
+ <swatches>
61
+ <file>cybage_swatches.xml</file>
62
+ </swatches>
63
+ </updates>
64
+ </layout>
65
+ <events>
66
+ <controller_action_postdispatch_adminhtml_catalog_product_attribute_save>
67
+ <observers>
68
+ <swatches_save_observer>
69
+ <type>singleton</type>
70
+ <class>swatches/observer</class>
71
+ <method>saveAttributesAfter</method>
72
+ </swatches_save_observer>
73
+ </observers>
74
+ </controller_action_postdispatch_adminhtml_catalog_product_attribute_save>
75
+ <catalog_product_save_before>
76
+
77
+ <observers>
78
+ <swatches_on_product_save>
79
+ <type>singleton</type>
80
+ <class>swatches/observer</class>
81
+ <method>saveCatalogProductAfter</method>
82
+ </swatches_on_product_save>
83
+ </observers>
84
+ </catalog_product_save_before>
85
+ </events>
86
+ </adminhtml>
87
+ <global>
88
+ <blocks>
89
+ <swatches>
90
+ <class>Cybage_Swatches_Block</class>
91
+ </swatches>
92
+ <adminhtml>
93
+ <rewrite>
94
+ <catalog_product_attribute_edit_tab_main>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Main</catalog_product_attribute_edit_tab_main>
95
+ <catalog_product_attribute_edit_tab_options>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Options</catalog_product_attribute_edit_tab_options>
96
+ <catalog_product_attribute_edit_form>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Form</catalog_product_attribute_edit_form>
97
+ <catalog_product_edit_tab_super_config_grid_renderer_checkbox>Cybage_Swatches_Block_Adminhtml_Catalog_Product_Attribute_Edit_Tab_Super_Config_Grid_Renderer</catalog_product_edit_tab_super_config_grid_renderer_checkbox>
98
+ </rewrite>
99
+ </adminhtml>
100
+ <catalog>
101
+ <rewrite>
102
+ <product_view_type_configurable>Cybage_Swatches_Block_Catalog_Product_View_Type_Configurable</product_view_type_configurable>
103
+ </rewrite>
104
+ </catalog>
105
+ </blocks>
106
+ <helpers>
107
+ <swatches>
108
+ <class>Cybage_Swatches_Helper</class>
109
+ </swatches>
110
+ <catalog>
111
+ <rewrite>
112
+ <product>Cybage_Swatches_Helper_Product</product>
113
+ </rewrite>
114
+ </catalog>
115
+ </helpers>
116
+ <models>
117
+ <swatches>
118
+ <class>Cybage_Swatches_Model</class>
119
+ <resourceModel>swatches_resource</resourceModel>
120
+ </swatches>
121
+ <swatches_resource>
122
+ <class>Cybage_Swatches_Model_Resource</class>
123
+ <entities>
124
+ <attribute>
125
+ <table>cybage_swatches_attribute</table>
126
+ </attribute>
127
+ </entities>
128
+ </swatches_resource>
129
+ </models>
130
+
131
+ <resources>
132
+ <swatches_read>
133
+ <connection><use>core_read</use></connection>
134
+ </swatches_read>
135
+ <swatches_write>
136
+ <connection><use>core_write</use></connection>
137
+ </swatches_write>
138
+ <swatches_setup>
139
+ <setup>
140
+ <module>Cybage_Swatches</module>
141
+ </setup>
142
+ <connection>
143
+ <use>core_setup</use>
144
+ </connection>
145
+ </swatches_setup>
146
+ </resources>
147
+ </global>
148
+ </config>
 
 
app/code/community/Cybage/Swatches/etc/system.xml CHANGED
@@ -55,7 +55,7 @@
55
  </show_swatches>
56
  </fields>
57
  </default>
58
- <list>
59
  <label>Category List Page Settings</label>
60
  <frontend_type>text</frontend_type>
61
  <sort_order>20</sort_order>
@@ -83,7 +83,7 @@
83
  </img_size_list>
84
  </fields>
85
  </list>
86
- <pdp>
87
  <label>Product Details Page Settings</label>
88
  <frontend_type>text</frontend_type>
89
  <sort_order>30</sort_order>
55
  </show_swatches>
56
  </fields>
57
  </default>
58
+ <list translate="label">
59
  <label>Category List Page Settings</label>
60
  <frontend_type>text</frontend_type>
61
  <sort_order>20</sort_order>
83
  </img_size_list>
84
  </fields>
85
  </list>
86
+ <pdp translate="label">
87
  <label>Product Details Page Settings</label>
88
  <frontend_type>text</frontend_type>
89
  <sort_order>30</sort_order>
app/etc/modules/Cybage_Swatches.xml CHANGED
@@ -24,6 +24,10 @@
24
  <Cybage_Swatches>
25
  <active>true</active>
26
  <codePool>community</codePool>
 
 
 
 
27
  </Cybage_Swatches>
28
  </modules>
29
  </config>
24
  <Cybage_Swatches>
25
  <active>true</active>
26
  <codePool>community</codePool>
27
+ <depends>
28
+ <Mage_Adminhtml/>
29
+ <Mage_Catalog/>
30
+ </depends>
31
  </Cybage_Swatches>
32
  </modules>
33
  </config>
media/swatches/.htaccess DELETED
@@ -1,25 +0,0 @@
1
- Options All -Indexes
2
- <IfModule mod_php5.c>
3
- php_flag engine 0
4
- </IfModule>
5
-
6
- AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
7
- Options -ExecCGI
8
-
9
- <IfModule mod_rewrite.c>
10
-
11
- ############################################
12
- ## enable rewrites
13
-
14
- Options +FollowSymLinks
15
- RewriteEngine on
16
-
17
- ############################################
18
- ## never rewrite for existing files
19
- RewriteCond %{REQUEST_FILENAME} !-f
20
-
21
- ############################################
22
- ## rewrite everything else to index.php
23
-
24
- RewriteRule .* ../get.php [L]
25
- </IfModule>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/swatches/images/.htaccess DELETED
@@ -1,25 +0,0 @@
1
- Options All -Indexes
2
- <IfModule mod_php5.c>
3
- php_flag engine 0
4
- </IfModule>
5
-
6
- AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
7
- Options -ExecCGI
8
-
9
- <IfModule mod_rewrite.c>
10
-
11
- ############################################
12
- ## enable rewrites
13
-
14
- Options +FollowSymLinks
15
- RewriteEngine on
16
-
17
- ############################################
18
- ## never rewrite for existing files
19
- RewriteCond %{REQUEST_FILENAME} !-f
20
-
21
- ############################################
22
- ## rewrite everything else to index.php
23
-
24
- RewriteRule .* ../get.php [L]
25
- </IfModule>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/swatches/images/232.jpg ADDED
Binary file
media/swatches/images/233.jpg ADDED
Binary file
media/swatches/images/234.jpg ADDED
Binary file
media/swatches/images/235.jpg ADDED
Binary file
media/swatches/images/236.jpg ADDED
Binary file
media/swatches/images/28.jpg ADDED
Binary file
media/swatches/products/.htaccess DELETED
@@ -1,25 +0,0 @@
1
- Options All -Indexes
2
- <IfModule mod_php5.c>
3
- php_flag engine 0
4
- </IfModule>
5
-
6
- AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
7
- Options -ExecCGI
8
-
9
- <IfModule mod_rewrite.c>
10
-
11
- ############################################
12
- ## enable rewrites
13
-
14
- Options +FollowSymLinks
15
- RewriteEngine on
16
-
17
- ############################################
18
- ## never rewrite for existing files
19
- RewriteCond %{REQUEST_FILENAME} !-f
20
-
21
- ############################################
22
- ## rewrite everything else to index.php
23
-
24
- RewriteRule .* ../get.php [L]
25
- </IfModule>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,33 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cybage_Swatches</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</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Administrator can use the Color Swatch plug-in for configurable products to define their color, related size, and price at Magento store. For example, you can sell t-shirts in two colors and three sizes. The plug-in is used to define any type of attribute such as size, price, manufacturer, and color.</summary>
10
- <description>Color swatch is a free Magento extension that can be used to display any of the product attributes as thumbnail images instead of showing as dropdown on product pages on your commerce website. Not only color but any of the custom options like color, size, etc. can be shown as swatches. It has a support for storing multiple images for each attribute and can be easily manageable from the admin panel. Color swatch plugin can be easily installed and integrated on your website using Magento connect. It can be applied to single attribute or multiple attributes of a single product and different swatch images can be uploaded for each of those attribute options. Detailed setup instructions and user guide is also available for this plugin.</description>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <notes>After installation of the Color Swatches plug-in, please clear the cache.</notes>
12
  <authors><author><name>Cybage Software Pvt. Ltd.</name><user>cybage</user><email>Support_Magento@cybage.com</email></author></authors>
13
- <date>2015-03-10</date>
14
- <time>11:49:48</time>
15
- <contents><target name="magecommunity"><dir name="Cybage"><dir name="Swatches"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Attribute"><dir name="Edit"><file name="Form.php" hash="af7cbe62251e2eb2f5e9162bf6755b76"/><dir name="Tab"><file name="Main.php" hash="55239421ceeb962578b256d29157e837"/><file name="Options.php" hash="138f7133fc9a1ecc6d7a8dc1893bb731"/><dir name="Super"><dir name="Config"><dir name="Grid"><file name="Renderer.php" hash="a502af0887ab515df51060c3a6844d79"/></dir></dir></dir></dir></dir></dir><dir name="Edit"><dir name="Tab"><dir name="Super"><file name="Config.php" hash="b2634a1dc8dc6052883c22fecefc99a9"/></dir></dir></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><dir name="View"><dir name="Type"><file name="Configurable.php" hash="32e6d9d638e4f1ddf6be7079ae5b1503"/><file name="ConfigurableList.php" hash="33202ef00c1b86bb5859ca33954f7fc6"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="718831a5462ff7051714a0bcb4f71e86"/><file name="Product.php" hash="85d86882c9a3d298c05f9be1a1868827"/></dir><dir name="Model"><file name="Attribute.php" hash="60cc2983759612b61dfae72f815dc488"/><dir name="Mysql4"><dir name="Attribute"><file name="Collection.php" hash="cc7f8e3c49ec5f19077bba7252316940"/></dir><file name="Attribute.php" hash="4d555f2b0df3ffbb10c082f0cb079887"/></dir><file name="Observer.php" hash="2e4b2600689dc800516450a75ab73154"/></dir><dir name="etc"><file name="adminhtml.xml" hash="02949e28fff6bb938f048c9edd89fd24"/><file name="config.xml" hash="501d31296fdd889d190d561935ef82b2"/><file name="system.xml" hash="135b73951746c4a5a04ccd4c0a5c5ae3"/></dir><dir name="sql"><dir name="swatches_setup"><file name="mysql4-install-1.0.0.php" hash="879f4dbc6b4a0a764e57f80f3510483f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cybage_Swatches.xml" hash="3bbc5c26a2ebd202911b7fdee78991f5"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cybage_swatches.xml" hash="96adb24ca6a7d410e493a2aed65f594f"/></dir><dir name="template"><dir name="cybage"><dir name="catalog"><dir name="product"><dir name="edit"><dir name="super"><file name="config.phtml" hash="428c8fbfec9435f55de21fb32cf84123"/></dir></dir></dir></dir><dir name="swatches"><file name="options.phtml" hash="7456ca85bb090ec4bb79737b83e0b20d"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cybage_swatches.xml" hash="0eab22119365021d4583f3d2e5f59a24"/></dir><dir name="template"><dir name="cybage"><dir name="swatches"><file name="configurable.phtml" hash="a2da9222d4e004a664a0ba6f108df23c"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="cybage"><dir name="swatches"><file name="configurable.js" hash="1f98e78d7d2254ea2da52a83325e98f7"/><file name="configurableList.js" hash="c76ac5ca86c8d8baf725f11e546a97b6"/><dir name="css"><file name="swatches.css" hash="66dd4b9ec053b84574dc91e59cb25b5b"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="swatches"><dir name="images"><file name=".htaccess" hash="08de5b2f5ea1ce6f51f40a19bacbf42e"/></dir><dir name="products"><file name=".htaccess" hash="08de5b2f5ea1ce6f51f40a19bacbf42e"/></dir><file name=".htaccess" hash="08de5b2f5ea1ce6f51f40a19bacbf42e"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cybage_Swatches</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Administrator can use the Color Swatch plug-in for configurable products to define their color, related size, and price at Magento store. For example, you can sell t-shirts in two colors and three sizes. The plug-in is used to define any type of attribute such as size, price, manufacturer, and color.</summary>
10
+ <description>Administrator can use the Color Swatch plug-in for configurable products to define their color, related size, and price at Magento store. For example, you can sell t-shirts in two colors and three sizes. The plug-in is used to define any type of attribute such as size, price, manufacturer, and color. &#xD;
11
+ Features&#xD;
12
+ &#x2022; Support multiple swatch images for attribute options &#xD;
13
+ &#x2022; Easy management of width and height of swatches &#xD;
14
+ &#x2022; Organization of images for the configurable product attributes&#xD;
15
+ &#x2022; Support for multiple attribute options&#xD;
16
+ &#x2022; Easy management of multiple attributes on a single product &#xD;
17
+ &#x2022; Convert product attribute options as swatches on configurable products&#xD;
18
+ &#x2022; Customers can view the simple products images based on their selection of Configurable products options.&#xD;
19
+ Benefits&#xD;
20
+ &#x2022; Easy installation and integration&#xD;
21
+ &#x2022; Configure products easily to get more business&#xD;
22
+ &#x2022; Open source implementation&#xD;
23
+ &#x2022; Easy management of color swatches at attribute and product level&#xD;
24
+ &#x2022; Customers can view different images based on their selection of the configurable product options&#xD;
25
+ </description>
26
  <notes>After installation of the Color Swatches plug-in, please clear the cache.</notes>
27
  <authors><author><name>Cybage Software Pvt. Ltd.</name><user>cybage</user><email>Support_Magento@cybage.com</email></author></authors>
28
+ <date>2015-04-14</date>
29
+ <time>12:26:24</time>
30
+ <contents><target name="magecommunity"><dir name="Cybage"><dir name="Swatches"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Attribute"><dir name="Edit"><file name="Form.php" hash="af7cbe62251e2eb2f5e9162bf6755b76"/><dir name="Tab"><file name="Main.php" hash="6d9c1f9553ed24bdabc044636a1ae3e5"/><file name="Options.php" hash="138f7133fc9a1ecc6d7a8dc1893bb731"/><dir name="Super"><dir name="Config"><dir name="Grid"><file name="Renderer.php" hash="a502af0887ab515df51060c3a6844d79"/></dir></dir></dir></dir></dir></dir><dir name="Edit"><dir name="Tab"><dir name="Super"><file name="Config.php" hash="b2634a1dc8dc6052883c22fecefc99a9"/></dir></dir></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><dir name="View"><dir name="Type"><file name="Configurable.php" hash="452cf33def79fe5b5d1813e81b208dd6"/><file name="ConfigurableList.php" hash="e06fbd5c035e35d82c7f9354d4c84b17"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="88e31f66e5594d0b38dbb2bb06e1793c"/><file name="Product.php" hash="ad44df491c490928b0ecaacd350b7f4b"/></dir><dir name="Model"><file name="Attribute.php" hash="60cc2983759612b61dfae72f815dc488"/><file name="Observer.php" hash="398d82edba4dc3078ff6eb4393c7f7ca"/><dir name="Resource"><dir name="Attribute"><file name="Collection.php" hash="29baf0d62274fe15ec4bb60bf41c7b1d"/></dir><file name="Attribute.php" hash="6b126b599fe0bdd265327f8cf01dd74a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="02949e28fff6bb938f048c9edd89fd24"/><file name="config.xml" hash="f8834ecaa64cd9038f8dcc24ac1b410f"/><file name="system.xml" hash="c37220adb050b9de86c42d1a75af8d09"/></dir><dir name="sql"><dir name="swatches_setup"><file name="mysql4-install-1.0.0.php" hash="879f4dbc6b4a0a764e57f80f3510483f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cybage_Swatches.xml" hash="e658f23e820ca720e9156697c9ad6e74"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cybage_swatches.xml" hash="96adb24ca6a7d410e493a2aed65f594f"/></dir><dir name="template"><dir name="cybage"><dir name="catalog"><dir name="product"><dir name="edit"><dir name="super"><file name="config.phtml" hash="428c8fbfec9435f55de21fb32cf84123"/></dir></dir></dir></dir><dir name="swatches"><file name="options.phtml" hash="7456ca85bb090ec4bb79737b83e0b20d"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cybage_swatches.xml" hash="0eab22119365021d4583f3d2e5f59a24"/></dir><dir name="template"><dir name="cybage"><dir name="swatches"><file name="configurable.phtml" hash="a2da9222d4e004a664a0ba6f108df23c"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="cybage"><dir name="swatches"><file name="configurable.js" hash="1f98e78d7d2254ea2da52a83325e98f7"/><file name="configurableList.js" hash="c76ac5ca86c8d8baf725f11e546a97b6"/><dir name="css"><file name="swatches.css" hash="66dd4b9ec053b84574dc91e59cb25b5b"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="swatches"><dir name="images"><file name="232.jpg" hash="63b2ca51b61f8e100ae1e75e7c8e049c"/><file name="233.jpg" hash="c6cb1e82c855ee7e4246befc8242f824"/><file name="234.jpg" hash="6667fbc5eceef420c48db237e4f8c4f6"/><file name="235.jpg" hash="01f0a7052a03de58d8b6f335f780097b"/><file name="236.jpg" hash="b9bcec81a0dc967d1c66ce2f712fdb37"/><file name="28.jpg" hash="60e463e2c27d55fed3b01fc62acbd5b0"/></dir></dir></target></contents>
31
  <compatible/>
32
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
33
  </package>