Custom EAV Frontend Input Renderer
Handy for adding an attribute to a product or category which needs a custom frontend input type.
Related cards:
Remove Customers From MySQL
Is this ok?
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_...
Fetching All Attributes For An Entity From The DB In One Query
Using the database to inspect EAV-based entity types can be a real pain in the ass, so here are a bunch of queries that let you inspect some popular EAV entity types easily. This practice can be applied to any EAV entity type, however as there are...
Product Attribute Addition
This code shows all possible configuration options for an attribute that I know of, you need not include all of these when adding an attribute (although it won't hurt)
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
...
EAV Tables
A list of EAV tables and their purpose.
|----------------------------+-------------------------------------------------------------------------------------|
| Table | Contains ...
Custom Admin Grid Column Renderer
When you need to display an image in a column, or format a value in a particular way, you can use a custom renderer to present the data differently.
Product EAV Attribute Set, Group and Attribute List
To see a list of all attribute sets, groups, and associated attributes for products, use this SQL. BONUS! Also shows the sort ordering, useful for determining which sort_order
you need to place an attribute in a certain position:
SELECT...
Removing Custom Attributes Across Multiple Products
If you have custom attributes named the same across multiple products, you
wish to remove said attributes, this might come in useful. The SQL below restricts
the removal of the attributes to a certain attribute set name, but you can remove
this is...
Config Controller Definition (Frontend & Admin)
Frontend With Route:
<config>
<frontend>
<routers>
<namespace_module>
<use>standard</use>
<args>
<module>Namespace_Module</module>
...
Adding Attributes To Other Entities With getDefaultEntities()
Don't do it!! I did the below:
public function getDefaultEntities()
{
return array(
'catalog_product' => array(
'attributes' => array(
'size_guide_id' => array(
...
Config Event Observer Definition (Frontend, Admin & Global)
Frontend:
<config>
<frontend>
<events>
<the_name_of_the_event_to_observe>
<observers>
<namespace_module>
<class>namespace_module/obser...