Adding magento attribute with custom input renderer

Posted on May 17th, 2013 | Posted by admin

This is example which will explain you, how to add new attribute with custom input render. You will be able to modify existing functionality, add javascript, some other option or change default input renderer by your wishes.

You probably will ask yourself, what is magento input renderer and I will explain. This is Magento php class which is in charge for “rendering” html form elements. In magento there are different classes for rendering, you can find them in next folder:/lib/Varien/Data/Form/Element. In this folder you will notice next classes for rendering: price, date, image and so on.
Let’s go with our example.
First of all, you should create magento setup file which will add new product attribute with custom frontend input render, example is below:

How to Obtain Custom Attribute Values in Magento

Posted on April 3rd, 2013 | Posted by admin

Today let’s talk about Magento and custom attributes. With Magento you can create as many custom attributes for your products as you like, and there are different attribute types such as:

  • Text Field
  • Text Area
  • Date
  • Yes/No
  • Multiple Select
  • Dropdown
  • Price
  • Gallery
  • Media Image
  • Fixed Product Tax

Magento: How to get all attribute codes by product object or attribute set ID

Posted on April 1st, 2013 | Posted by admin

I’m writing an script for exporting Magento products to an XML file. In my PHP script, I have decided to create an class for holding the data of Magento product. In that class which defines all attributes from a product like the editing product screen from back-end

Magento: How to get all attribute codes by product object or attribute set ID

Magento: Bulk Update Product Attribute (using sql file or from a controller)

Posted on December 14th, 2012 | Posted by admin

After creating a New Magento Module to add special functionality to catalog products I needed to set the value for this product to all downloadable products that were already created because this is a required attribute and the site would not function correctly with out it. So here is how you can update an attribute(s) for a given set of products. Please note that this will update a text attribute. If you are trying to update a select or multiselect attribute you may need to format you values differently.

If you can not figure out the exact format you need you can test it by doing a bulk attribute update from the admin and edit the file for Mage_Catalog_Model_Product_Action class and in the updateAttributes method just print the value for $attrData. Then mimic this in you update script.

Add/Update Attribute Option Values Programmatically in Magento

Posted on September 16th, 2012 | Posted by admin

Adding/Updating the attribute option values programmatically in Magento can be tedious sometimes. Adding attribute options through custom codes is not big deal but updating the values for already added attribute options is tricky enough.
Problem: Lets understand this by an example. Suppose we have a product attribute ‘manufacturer’. It is of type select/dropdown. And we have few options added in it like Mac, Google, Android etc. Now at some point in our Magento application we want to update these options with Apple, Nexus, HTC etc without using the admin panel, then it is a problem.

Add/Update Attribute Option Values Programmatically in Magento

Page 1 of 3123»