Limiting The Number of Autocomplete Results
SweetTooth details how to limit the number of autocomplete entries, as by default this list is not limited whatsoever, not good on a store with lots of products!
Related cards:
Getting The Amount Of Items in the Cart
To get the amount of line items (i.e. 10 of 1 product is 1):
Mage::helper('checkout/cart')->getItemsCount();
To get the total number of items (i.e. 10 of 1 product is 10):
Mage::helper('checkout/cart')->getSummaryCount();
![](http://mi...
Getting the Theme In Use
How to get the theme for each component, works on the active store:
Mage::getSingleton('core/design_package')->getTheme('locale');
Mage::getSingleton('core/design_package')->getTheme('template');
Mage::getSingleton('core/design_packag...
Changing The Admin Theme
Put this in your local.xml
:
<config>
<stores>
<admin>
<design>
<theme>
<default>yourtheme</default>
</theme>
</design>
...
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...
Collection Manipulation (Filtering, Limiting, etc)
A list of collection methods, similar to this
Where
OR:
You have to first specify an array of attributes in the filter, then a two dimensi...
Display Out Of Stock Configuration Option
The decision of whether to show or hide a product based on this setting is implemented
by the Product Price Index.
You can verify this by changing the setting to "Yes" and then viewing ...
Allowing Import Of Invisible Attributes
By setting a Product Attribute to be invisible via the visible
property, you stop the ability to import that attribute unless you alter the _forcedAttributesCodes
property of...
Get Methods of Class
Yes, very dirty, but it works a treat! Save this file in your Magento root directory, then fire up a command line and run whatever.php Mage_Core_Model_App
(or some other class) and you should see the output.
Output looks like below:
$ ./cl...
Children of Anonymous Blocks are Orphaned
What a sad state of affairs. If a childs parent has no name, the child block becomes orphaned and alone, somewhere lost in Layout XML hell. To sort it, give the parent a name. The reason? The layout XML parser uses the name of the parent in XML to...
Using Design Exceptions To Serve a Mobile Theme
In order to serve a different package, or any element of a theme (translations, templates, skin or layout) you can use design exceptions, which allow you to specify different values for each of the design-related settings by using user-agent strin...