This list is partly to remind myself what essential apps need to be reinstalled after a system wipe.
But it does have me thinking, what do other web developers use on a daily basis?
- Google Chrome
- Adblock Plus
- British English Dictionary
- Dummy Lipsum
- Html Validator
- Web Developer
- Eclipse PDT
- Jungle Disk Workgroup Edition
- Adobe CS
- MS Office
- Google Apps Sync
- Foxit Reader
- Zoom phone adapter (use the Vista 64bit driver to get this working on 64bit Windows 7)
- Digital Clock
- GMail Counter
Ace on DHBiT pointed me at http://ninite.com/, how very useful. Will make use of it next time 🙂
Requirement: pre-filter products by customer group name to product attribute.
I was looking for the “proper” way of filtering items by multiple custom attribute settings, but couldn’t find out how.
So, the following is a brief explanation of how I’ve got this running in Magento 1.4.1.
There are two ways of editing core code in Magento.
- Wrong: edit files directly in
- Right: extend modules and keep them in
If you’re in a hurry, you might edit core files directly and then later copy the altered code out into correctly extended module files.
For most of my Magento work, this is the route I have taken: get it working in the core then extend it once I’m sure I’m messing with the correct file/method. Just be sure to copy the code out at some point before upgrading the core!
This is how I have extended
app/code/core/Mage/Catalog/Block/Product/List.php – the method which generates the product list when viewing a category.
The extended file would be saved to
_productCollection = $layer->getProductCollection();
// fetch the list of schools and their associated IDs
$_product = Mage::getModel('catalog/product');
$_attributes = Mage::getResourceModel('eav/entity_attribute_collection')
$_attribute = $_attributes->getFirstItem()->setEntity($_product->getResource());
$stv_schools = $_attribute->getSource()->getAllOptions(false);
$schools = array();
foreach ($stv_schools as $stv_school)
$schools[$stv_school['label']] = $stv_school['value'];
// Filter by school name and non specific items
$allowedSchools = array($schools["Non specific"]);
$customer_groupID = Mage::getSingleton('customer/session')->isLoggedIn() ? Mage::getSingleton('customer/session')->getCustomerGroupId() : null;
if ($customer_groupID !== null)
$groupName = Mage::getSingleton('customer/group')->load($customer_groupID)->getData('customer_group_code');
$allowedSchools = $schools[$groupName];
// ... snipped - be sure to copy correctly from the original source file ... //
Reason I have used such a long and ugly method:
addAttributeToFilter() will only play ball with attribute value IDs.
By fetching possible attribute value text and IDs, flipping the data, we can successfully filter by human readable text.
Further reading on how to set up a module for extension, see http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code