Let’s initiate a discussion!!
Step 1: Create /app/code/local/Magemonkeys/Customerattribute/sql/magemonkeys_myattribute_setup/install-0.1.0.php file and add the following code in this file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
<?php $installer = $this; $installer->startSetup(); $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $entityTypeId = $setup->getEntityTypeId('customer'); $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId); $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); $setup->addAttribute("customer", "myattribute", array( "type" => "varchar", "backend" => "", "label" => "My Attribute", "input" => "text", "source" => "", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => "My Attribute" )); $attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "myattribute"); $setup->addAttributeToGroup( $entityTypeId, $attributeSetId, $attributeGroupId, 'myattribute', '1000' ); $usedIn=array(); $usedIn[]="adminhtml_customer"; $usedIn[]="checkout_register"; $usedIn[]="customer_account_create"; $usedIn[]="customer_account_edit"; $usedIn[]="adminhtml_checkout"; $attribute->setData("used_in_forms", $usedIn) ->setData("is_used_for_customer_segment", true) ->setData("is_system", 0) ->setData("is_user_defined", 1) ->setData("is_visible", 1) ->setData("sort_order", 101) ; $attribute->save(); $installer->endSetup(); ?> |
Step 2: Create /app/code/local/Magemonkeys/Customerattribute/etc/config.xml and add the following code in this file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<?xml version="1.0"?> <config> <modules> <Magemonkeys_Customerattribute> <version>0.1.0</version> </Magemonkeys_Customerattribute> </modules> <global> <resources> <Magemonkeys_Myattribute_setup> <setup> <module>Magemonkeys_Customerattribute</module> <class>Mage_Customer_Model_Entity_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </Magemonkeys_Myattribute_setup> <Magemonkeys_Myattribute_write> <connection> <use>core_write</use> </connection> </Magemonkeys_Myattribute_write> <Magemonkeys_Myattribute_read> <connection> <use>core_read</use> </connection> </Magemonkeys_Myattribute_read> </resources> </global> </config> |
Step 3: Create app/etc/modules/Magemonkeys_Customerattribute.xml and add the following code in this file:
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0"?> <config> <modules> <Magemonkeys_Customerattribute> <active>true</active> <codePool>local</codePool> </Magemonkeys_Customerattribute> </modules> </config> |
[crayon-641fab3023672190547304/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.