Amar_Profile - Version 0.4.0

Version Notes

This Extension helps to create the customer attribute and provides the backend control to create and manage and create attribute will be used in customer general information

Download this release

Release Info

Developer AmarInfotech
Extension Amar_Profile
Version 0.4.0
Comparing to
See all releases


Code changes from version 0.3.0 to 0.4.0

app/code/community/Amar/Profile/Block/Adminhtml/Customer/Attribute/Edit/Tab/Main.php CHANGED
@@ -105,6 +105,14 @@ class Amar_Profile_Block_Adminhtml_Customer_Attribute_Edit_Tab_Main extends Mage
105
  'values'=> $scopes
106
  ), 'attribute_code');
107
 
 
 
 
 
 
 
 
 
108
  // frontend properties fieldset
109
 
110
 
105
  'values'=> $scopes
106
  ), 'attribute_code');
107
 
108
+
109
+ $fieldset->addField('sort_order', 'text', array(
110
+ 'name' => 'sort_order',
111
+ 'label' => Mage::helper('profile')->__('Sort Order'),
112
+ 'title' => Mage::helper('profile')->__('Sort Order'),
113
+ 'note' => Mage::helper('profile')->__('This is the order according to which this field will display.')
114
+ ));
115
+
116
  // frontend properties fieldset
117
 
118
 
app/code/community/Amar/Profile/Block/Customer/Account/Create.php CHANGED
@@ -101,7 +101,7 @@ class Amar_Profile_Block_Customer_Account_Create extends Mage_Core_Block_Templat
101
  {
102
  $attributeCodes = array();
103
 
104
- $profileAttributeCollection = Mage::getModel("profile/profile")->getCollection();
105
 
106
  foreach($profileAttributeCollection as $profile_id => $_profile)
107
  {
101
  {
102
  $attributeCodes = array();
103
 
104
+ $profileAttributeCollection = Mage::getModel("profile/profile")->getCollection()->setOrder('sort_order','asc');
105
 
106
  foreach($profileAttributeCollection as $profile_id => $_profile)
107
  {
app/code/community/Amar/Profile/controllers/Adminhtml/Customer/AttributeController.php CHANGED
@@ -277,12 +277,20 @@ class Amar_Profile_Adminhtml_Customer_AttributeController extends Mage_Adminhtml
277
  $profileCollection = Mage::getModel("profile/profile")->getCollection()
278
  ->addFieldtoFilter("attribute_code",$model->getAttributeCode())
279
  ->addFieldtoFilter("attribute_id",$model->getAttributeId());
 
280
 
281
- if($profileCollection->getSize() == 0)
282
  {
283
- Mage::getModel("profile/profile")->setAttributeCode($model->getAttributeCode())->setAttributeId($model->getAttributeId())->save();
 
 
 
 
284
  }
285
-
 
 
 
286
  //code to update the data of the profile ends here
287
 
288
  Mage::getSingleton('eav/config')
277
  $profileCollection = Mage::getModel("profile/profile")->getCollection()
278
  ->addFieldtoFilter("attribute_code",$model->getAttributeCode())
279
  ->addFieldtoFilter("attribute_id",$model->getAttributeId());
280
+ $profileModel = Mage::getModel("profile/profile");
281
 
282
+ if($profileCollection->getSize() != 0)
283
  {
284
+ foreach($profileCollection as $_profile)
285
+ {
286
+ $profileModel = $profileModel->load($_profile->getId());
287
+ break;
288
+ }
289
  }
290
+ $profileModel->setAttributeCode($model->getAttributeCode())
291
+ ->setAttributeId($model->getAttributeId())
292
+ ->setSortOrder($model->getSortOrder())
293
+ ->save();
294
  //code to update the data of the profile ends here
295
 
296
  Mage::getSingleton('eav/config')
app/code/community/Amar/Profile/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Amar_Profile>
5
- <version>0.3.0</version>
6
  </Amar_Profile>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Amar_Profile>
5
+ <version>0.4.0</version>
6
  </Amar_Profile>
7
  </modules>
8
 
app/code/community/Amar/Profile/sql/profile_setup/mysql4-upgrade-0.3.0-0.4.0.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+
8
+ $installer->run("ALTER TABLE `".$this->getTable("profile/profile")."` ADD sort_order int AFTER attribute_code;");
9
+
10
+
11
+ $installer->endSetup();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Amar_Profile</name>
4
- <version>0.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>This Extension helps to create the customer attribute and provides the backend control to create and manage and create attribute will be used in customer general information.</description>
11
  <notes>This Extension helps to create the customer attribute and provides the backend control to create and manage and create attribute will be used in customer general information</notes>
12
  <authors><author><name>AmarInfotech</name><user>Amar</user><email>info@amarinfotech.com</email></author></authors>
13
- <date>2014-05-23</date>
14
- <time>11:00:06</time>
15
- <contents><target name="magecommunity"><dir name="Amar"><dir name="Profile"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Attribute"><dir name="Edit"><file name="Form.php" hash="bc8725fc0ed75bfa0741eb38e6c77faf"/><dir name="Tab"><file name="Main.php" hash="de003fabb3f4c8a11e66f4b39ce89c26"/><file name="Options.php" hash="f8a9b18c7acf71ddf34b6f23ca24a57c"/><file name="System.php" hash="50d582b0f580a5a524700b6c59029bc5"/></dir><file name="Tabs.php" hash="c6680da61dda70e123412c47224919e5"/></dir><file name="Edit.php" hash="b0ec4086b79c6cd1fe43444523b9d2be"/><file name="Grid.php" hash="72120452b25513d160493c76403bce4d"/></dir><file name="Attribute.php" hash="ea0c9db354e9826536857059a84e14e7"/></dir></dir><dir name="Customer"><dir name="Account"><file name="Create.php" hash="0a8fdd9007f9bc1ea033c6ff835cfdbe"/></dir></dir><file name="Profile.php" hash="f64035ee37649dd45ad77720cc8226db"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Customer"><file name="AttributeController.php" hash="0e37edc5c370f2d3107fd860ab7f0313"/></dir></dir><file name="IndexController.php" hash="84f1bc97bba2242ed1319b4315ea62ff"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c0937f0cf17ab2a47d20027836b3a1cc"/><file name="config.xml" hash="22aa1735c2baf8d46180a02a0098d698"/></dir><dir name="Helper"><file name="Data.php" hash="178a285868201245fb3081568b47d748"/><file name="Product.php" hash="5bbeb6168666b6298c0a8b6cf0da1f62"/></dir><dir name="Model"><dir name="Customer"><file name="Attribute.php" hash="d8eaeb270892965ab6f3515f6cf7d7c1"/></dir><dir name="Mysql4"><dir name="Customer"><dir name="Attribute"><file name="Collection.php" hash="7649220d3fbc1609540e8da38b5c5dbf"/></dir></dir><dir name="Profile"><file name="Collection.php" hash="cf117bb9387b6585138459e5e4893aab"/></dir><file name="Profile.php" hash="52e2360f0bd30ed858dd2cc7ef724a51"/><file name="Setup.php" hash="3ec40b3b2d0d7149503f2ab2f3683169"/></dir><file name="Profile.php" hash="ce2bc5a09bdb4fe4bec277462e6ac3f6"/></dir><dir name="sql"><dir name="profile_setup"><file name="mysql4-install-0.3.0.php" hash="d8834258f80ec582edb79d558bd747ae"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amar_Profile.xml" hash="413caa965c13cb857187e5975a6a3015"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="profile.xml" hash="f8a396e7610ec278706485316bf2771a"/></dir><dir name="template"><dir name="profile"><dir name="customer"><dir name="attribute"><file name="js.phtml" hash="58c136f2c9a5408eff512b2c8ba6fc59"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="profile.xml" hash="7626b18d044cee5c000e3020c8d5676b"/></dir><dir name="template"><dir name="profile"><dir name="customer"><dir name="account"><file name="create.phtml" hash="931f0745196ae5cce269d86ea88c9aca"/><file name="edit.phtml" hash="68932091cccd0dba2655638df0ff1d3d"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="profile"><file name="conflictAttribute.js" hash="429061ff085844228016d377843929e8"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Amar_Profile</name><channel>community</channel><min>1.6</min><max>1.9</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Amar_Profile</name>
4
+ <version>0.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>This Extension helps to create the customer attribute and provides the backend control to create and manage and create attribute will be used in customer general information.</description>
11
  <notes>This Extension helps to create the customer attribute and provides the backend control to create and manage and create attribute will be used in customer general information</notes>
12
  <authors><author><name>AmarInfotech</name><user>Amar</user><email>info@amarinfotech.com</email></author></authors>
13
+ <date>2014-05-30</date>
14
+ <time>13:30:45</time>
15
+ <contents><target name="magecommunity"><dir name="Amar"><dir name="Profile"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Attribute"><dir name="Edit"><file name="Form.php" hash="bc8725fc0ed75bfa0741eb38e6c77faf"/><dir name="Tab"><file name="Main.php" hash="2526b7eadf829b3a2135da12b8b6295c"/><file name="Options.php" hash="f8a9b18c7acf71ddf34b6f23ca24a57c"/><file name="System.php" hash="50d582b0f580a5a524700b6c59029bc5"/></dir><file name="Tabs.php" hash="c6680da61dda70e123412c47224919e5"/></dir><file name="Edit.php" hash="b0ec4086b79c6cd1fe43444523b9d2be"/><file name="Grid.php" hash="72120452b25513d160493c76403bce4d"/></dir><file name="Attribute.php" hash="ea0c9db354e9826536857059a84e14e7"/></dir></dir><dir name="Customer"><dir name="Account"><file name="Create.php" hash="4e53cf5e13a9f4c733919611bcc57300"/></dir></dir><file name="Profile.php" hash="f64035ee37649dd45ad77720cc8226db"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Customer"><file name="AttributeController.php" hash="df069c69c2bc6b1a82ea6c947102af6b"/></dir></dir><file name="IndexController.php" hash="84f1bc97bba2242ed1319b4315ea62ff"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c0937f0cf17ab2a47d20027836b3a1cc"/><file name="config.xml" hash="2179cacc17e47caa1b67345444d39740"/></dir><dir name="Helper"><file name="Data.php" hash="178a285868201245fb3081568b47d748"/><file name="Product.php" hash="5bbeb6168666b6298c0a8b6cf0da1f62"/></dir><dir name="Model"><dir name="Customer"><file name="Attribute.php" hash="d8eaeb270892965ab6f3515f6cf7d7c1"/></dir><dir name="Mysql4"><dir name="Customer"><dir name="Attribute"><file name="Collection.php" hash="7649220d3fbc1609540e8da38b5c5dbf"/></dir></dir><dir name="Profile"><file name="Collection.php" hash="cf117bb9387b6585138459e5e4893aab"/></dir><file name="Profile.php" hash="52e2360f0bd30ed858dd2cc7ef724a51"/><file name="Setup.php" hash="3ec40b3b2d0d7149503f2ab2f3683169"/></dir><file name="Profile.php" hash="ce2bc5a09bdb4fe4bec277462e6ac3f6"/></dir><dir name="sql"><dir name="profile_setup"><file name="mysql4-install-0.3.0.php" hash="d8834258f80ec582edb79d558bd747ae"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="7e6db7b4679fa2dba3ab6fecbbdbc1ab"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amar_Profile.xml" hash="413caa965c13cb857187e5975a6a3015"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="profile.xml" hash="f8a396e7610ec278706485316bf2771a"/></dir><dir name="template"><dir name="profile"><dir name="customer"><dir name="attribute"><file name="js.phtml" hash="58c136f2c9a5408eff512b2c8ba6fc59"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="profile.xml" hash="7626b18d044cee5c000e3020c8d5676b"/></dir><dir name="template"><dir name="profile"><dir name="customer"><dir name="account"><file name="create.phtml" hash="931f0745196ae5cce269d86ea88c9aca"/><file name="edit.phtml" hash="68932091cccd0dba2655638df0ff1d3d"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="profile"><file name="conflictAttribute.js" hash="429061ff085844228016d377843929e8"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Amar_Profile</name><channel>community</channel><min>1.6</min><max>1.9</max></package></required></dependencies>
18
  </package>