Version Notes
After bug in version 1.0.1 , now we realese 1.0.2 version...
Download this release
Release Info
| Developer | Komang Novayadi |
| Extension | Dewatasoft_ChangeAttributeSet |
| Version | 1.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Dewatasoft/ChangeAttributeSet/Helper/Data.php +12 -0
- app/code/community/Dewatasoft/ChangeAttributeSet/Model/Observer.php +70 -0
- app/code/community/Dewatasoft/ChangeAttributeSet/controllers/Adminhtml/Catalog/ProductController.php +66 -0
- app/code/community/Dewatasoft/ChangeAttributeSet/etc/adminhtml.xml +23 -0
- app/code/community/Dewatasoft/ChangeAttributeSet/etc/config.xml +64 -0
- app/code/community/Dewatasoft/ChangeAttributeSet/etc/system.xml +40 -0
- package.xml +9 -10
app/code/community/Dewatasoft/ChangeAttributeSet/Helper/Data.php
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Dewatasoft ChangeAttributeSet Helper
|
| 4 |
+
*
|
| 5 |
+
* @category Mage
|
| 6 |
+
* @package Dewatasoft_ChangeAttributeSet_Helper
|
| 7 |
+
* @author Dewatasoft Team <komang@dewatasoft.com>
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
class Dewatasoft_ChangeAttributeSet_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 11 |
+
|
| 12 |
+
}
|
app/code/community/Dewatasoft/ChangeAttributeSet/Model/Observer.php
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-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 Mage
|
| 22 |
+
* @package Dewatasoft_ChangeAttributeSet_Adminhtml
|
| 23 |
+
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Dewatasoft ChangeAttributeSet Observer Model
|
| 29 |
+
*
|
| 30 |
+
* @category Mage
|
| 31 |
+
* @package Dewatasoft_ChangeAttributeSet_Model_Observer
|
| 32 |
+
* @author Dewatasoft Team <komang@dewatasoft.com>
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
class Dewatasoft_ChangeAttributeSet_Model_Observer
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
/**
|
| 39 |
+
* add Massaction Option to Product grid
|
| 40 |
+
*
|
| 41 |
+
* @param $observer Varien_Event
|
| 42 |
+
*/
|
| 43 |
+
public function addMassactionToProductGrid($observer)
|
| 44 |
+
{
|
| 45 |
+
$block = $observer->getBlock();
|
| 46 |
+
|
| 47 |
+
if($block instanceof Mage_Adminhtml_Block_Catalog_Product_Grid){
|
| 48 |
+
|
| 49 |
+
$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
|
| 50 |
+
->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
|
| 51 |
+
->load()
|
| 52 |
+
->toOptionHash();
|
| 53 |
+
|
| 54 |
+
$block->getMassactionBlock()->addItem('flagbit_changeattributeset', array(
|
| 55 |
+
'label'=> Mage::helper('catalog')->__('Change attribute set'),
|
| 56 |
+
'url' => $block->getUrl('*/*/changeattributeset', array('_current'=>true)),
|
| 57 |
+
'additional' => array(
|
| 58 |
+
'visibility' => array(
|
| 59 |
+
'name' => 'attribute_set',
|
| 60 |
+
'type' => 'select',
|
| 61 |
+
'class' => 'required-entry',
|
| 62 |
+
'label' => Mage::helper('catalog')->__('Attribute Set'),
|
| 63 |
+
'values' => $sets
|
| 64 |
+
)
|
| 65 |
+
)
|
| 66 |
+
));
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
}
|
app/code/community/Dewatasoft/ChangeAttributeSet/controllers/Adminhtml/Catalog/ProductController.php
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-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 Mage
|
| 22 |
+
* @package Dewatasoft_ChangeAttributeSet_Adminhtml
|
| 23 |
+
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Dewatasoft Catalog product controller
|
| 29 |
+
*
|
| 30 |
+
* @category Mage
|
| 31 |
+
* @package Dewatasoft_ChangeAttributeSet_Adminhtml
|
| 32 |
+
* @author Dewatasoft Team <komang@dewatasoft.com>
|
| 33 |
+
*/
|
| 34 |
+
class Dewatasoft_ChangeAttributeSet_Adminhtml_Catalog_ProductController extends Mage_Adminhtml_Controller_Action
|
| 35 |
+
{
|
| 36 |
+
|
| 37 |
+
public function changeattributesetAction()
|
| 38 |
+
{
|
| 39 |
+
$productIds = $this->getRequest()->getParam('product');
|
| 40 |
+
$storeId = (int)$this->getRequest()->getParam('store', 0);
|
| 41 |
+
if (!is_array($productIds)) {
|
| 42 |
+
$this->_getSession()->addError($this->__('Please select product(s)'));
|
| 43 |
+
}
|
| 44 |
+
else {
|
| 45 |
+
try {
|
| 46 |
+
foreach ($productIds as $productId) {
|
| 47 |
+
$product = Mage::getSingleton('catalog/product')
|
| 48 |
+
->unsetData()
|
| 49 |
+
->setStoreId($storeId)
|
| 50 |
+
->load($productId)
|
| 51 |
+
->setAttributeSetId($this->getRequest()->getParam('attribute_set'))
|
| 52 |
+
->setIsMassupdate(true)
|
| 53 |
+
->save();
|
| 54 |
+
}
|
| 55 |
+
Mage::dispatchEvent('catalog_product_massupdate_after', array('products'=>$productIds));
|
| 56 |
+
$this->_getSession()->addSuccess(
|
| 57 |
+
$this->__('Total of %d record(s) were successfully updated', count($productIds))
|
| 58 |
+
);
|
| 59 |
+
}
|
| 60 |
+
catch (Exception $e) {
|
| 61 |
+
$this->_getSession()->addException($e, $e->getMessage());
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
$this->_redirect('adminhtml/catalog_product/index/', array());
|
| 65 |
+
}
|
| 66 |
+
}
|
app/code/community/Dewatasoft/ChangeAttributeSet/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<acl>
|
| 4 |
+
<resources>
|
| 5 |
+
<admin>
|
| 6 |
+
<children>
|
| 7 |
+
<system>
|
| 8 |
+
<children>
|
| 9 |
+
<config>
|
| 10 |
+
<children>
|
| 11 |
+
<changeattributeset translate="title" module="changeattributeset">
|
| 12 |
+
<title>About Module Section</title>
|
| 13 |
+
<sort_order>0</sort_order>
|
| 14 |
+
</changeattributeset>
|
| 15 |
+
</children>
|
| 16 |
+
</config>
|
| 17 |
+
</children>
|
| 18 |
+
</system>
|
| 19 |
+
</children>
|
| 20 |
+
</admin>
|
| 21 |
+
</resources>
|
| 22 |
+
</acl>
|
| 23 |
+
</config>
|
app/code/community/Dewatasoft/ChangeAttributeSet/etc/config.xml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Dewatasoft_ChangeAttributeSet>
|
| 5 |
+
<version>1.0.2</version>
|
| 6 |
+
</Dewatasoft_ChangeAttributeSet>
|
| 7 |
+
</modules>
|
| 8 |
+
|
| 9 |
+
<global>
|
| 10 |
+
<models>
|
| 11 |
+
<dewatasoft_changeattributeset>
|
| 12 |
+
<class>Dewatasoft_ChangeAttributeSet_Model</class>
|
| 13 |
+
</dewatasoft_changeattributeset>
|
| 14 |
+
</models>
|
| 15 |
+
|
| 16 |
+
<helpers>
|
| 17 |
+
<changeattributeset>
|
| 18 |
+
<class>Dewatasoft_ChangeAttributeSet_Helper</class>
|
| 19 |
+
</changeattributeset>
|
| 20 |
+
</helpers>
|
| 21 |
+
</global>
|
| 22 |
+
<adminhtml>
|
| 23 |
+
<events>
|
| 24 |
+
<adminhtml_block_html_before>
|
| 25 |
+
<observers>
|
| 26 |
+
<dewatasoft_changeattributeset>
|
| 27 |
+
<type>singleton</type>
|
| 28 |
+
<class>dewatasoft_changeattributeset/observer</class>
|
| 29 |
+
<method>addMassactionToProductGrid</method>
|
| 30 |
+
</dewatasoft_changeattributeset>
|
| 31 |
+
</observers>
|
| 32 |
+
</adminhtml_block_html_before>
|
| 33 |
+
</events>
|
| 34 |
+
<translate>
|
| 35 |
+
<modules>
|
| 36 |
+
<Dewatasoft_ChangeAttributeSet>
|
| 37 |
+
<files>
|
| 38 |
+
<default>Dewatasoft_ChangeAttributeSet.csv</default>
|
| 39 |
+
</files>
|
| 40 |
+
</Dewatasoft_ChangeAttributeSet>
|
| 41 |
+
</modules>
|
| 42 |
+
</translate>
|
| 43 |
+
</adminhtml>
|
| 44 |
+
<default>
|
| 45 |
+
<changeattributeset>
|
| 46 |
+
<default>
|
| 47 |
+
<enable>1</enable>
|
| 48 |
+
</default>
|
| 49 |
+
</changeattributeset>
|
| 50 |
+
</default>
|
| 51 |
+
|
| 52 |
+
<admin>
|
| 53 |
+
<routers>
|
| 54 |
+
<adminhtml>
|
| 55 |
+
<args>
|
| 56 |
+
<modules>
|
| 57 |
+
<Dewatasoft_ChangeAttributeSet before="Mage_Adminhtml">Dewatasoft_ChangeAttributeSet_Adminhtml</Dewatasoft_ChangeAttributeSet>
|
| 58 |
+
</modules>
|
| 59 |
+
</args>
|
| 60 |
+
</adminhtml>
|
| 61 |
+
</routers>
|
| 62 |
+
</admin>
|
| 63 |
+
|
| 64 |
+
</config>
|
app/code/community/Dewatasoft/ChangeAttributeSet/etc/system.xml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<changeattributeset translate="label" module="changeattributeset">
|
| 5 |
+
<label>Dewatasoft,inc</label>
|
| 6 |
+
<tab>catalog</tab>
|
| 7 |
+
<frontend_type>text</frontend_type>
|
| 8 |
+
<sort_order>0</sort_order>
|
| 9 |
+
<show_in_default>1</show_in_default>
|
| 10 |
+
<show_in_website>1</show_in_website>
|
| 11 |
+
<show_in_store>1</show_in_store>
|
| 12 |
+
<groups>
|
| 13 |
+
<default translate="label comment" module="changeattributeset">
|
| 14 |
+
<label>Configuration</label>
|
| 15 |
+
<comment>
|
| 16 |
+
<![CDATA[<p style="background-color: #EEE2BE; border: 1px solid orange;font-weight: bold; padding: 20px;">This ext used to change attribute set of one or multi products with easier...<br/>
|
| 17 |
+
This ext developed by Novayadi <a href="http://www.novayadi.com" target="_blank">Novayadi.COM</a><br /></p>]]>
|
| 18 |
+
</comment>
|
| 19 |
+
<frontend_type>text</frontend_type>
|
| 20 |
+
<sort_order>10</sort_order>
|
| 21 |
+
<show_in_default>1</show_in_default>
|
| 22 |
+
<show_in_website>1</show_in_website>
|
| 23 |
+
<show_in_store>1</show_in_store>
|
| 24 |
+
|
| 25 |
+
<fields>
|
| 26 |
+
<enable>
|
| 27 |
+
<label>Enable</label>
|
| 28 |
+
<frontend_type>select</frontend_type>
|
| 29 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 30 |
+
<sort_order>0</sort_order>
|
| 31 |
+
<show_in_default>1</show_in_default>
|
| 32 |
+
<show_in_website>1</show_in_website>
|
| 33 |
+
<show_in_store>1</show_in_store>
|
| 34 |
+
</enable>
|
| 35 |
+
</fields>
|
| 36 |
+
</default>
|
| 37 |
+
</groups>
|
| 38 |
+
</changeattributeset>
|
| 39 |
+
</sections>
|
| 40 |
+
</config>
|
package.xml
CHANGED
|
@@ -1,19 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Dewatasoft_ChangeAttributeSet</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
-
<license uri="http://opensource.org/licenses/osl-3.0.php">
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>
|
| 10 |
-
<description>
|
| 11 |
-
|
| 12 |
-
<
|
| 13 |
-
<
|
| 14 |
-
<
|
| 15 |
-
<
|
| 16 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Dewatasoft_ChangeAttributeSet.xml" hash="77ddd3155ab19436d50f2f0a4001a473"/></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Dewatasoft_ChangeAttributeSet</name>
|
| 4 |
+
<version>1.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">GNU general public license</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>Change attribute set</summary>
|
| 10 |
+
<description>Default system 'attribute set' must set when adding new products, with this can switch from grid products. </description>
|
| 11 |
+
<notes>After bug in version 1.0.1 , now we realese 1.0.2 version...</notes>
|
| 12 |
+
<authors><author><name>Komang Novayadi</name><user>novayadi</user><email>komang@novayadi.com</email></author></authors>
|
| 13 |
+
<date>2017-02-07</date>
|
| 14 |
+
<time>22:26:58</time>
|
| 15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Dewatasoft_ChangeAttributeSet.xml" hash="77ddd3155ab19436d50f2f0a4001a473"/></dir></target><target name="magecommunity"><dir name="Dewatasoft"><dir name="ChangeAttributeSet"><dir name="Helper"><file name="Data.php" hash="9a0d9d43acee2ba5f6022f14ea8056d5"/></dir><dir name="Model"><file name="Observer.php" hash="a71cfcc19a026782fd18541ee4bc082b"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Catalog"><file name="ProductController.php" hash="5f54139de0e08d3da6b53d1ad68b423e"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aa45fb71488fc75b45f1887f02019dc8"/><file name="config.xml" hash="896391526b28fe71b5896f2bfbe15095"/><file name="system.xml" hash="d1c403ce1ebd0e6e528f1f0c75b752b9"/></dir></dir></dir></target></contents>
|
|
|
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
