The week on StackExchange #23 / 2016

Shortly before the 5th MageStackDay, here are some questions and answers on magento.stackexchange.com from last week that might interest you:

Magento 2

  • Without answer yet, and probably there is no solution as of Magento 2.0: Localized frontend value for getCustomAttribute() (select or multiselect attributes) – but as I commented: I’m going to continue to ask these questions when I’m hitting walls, and if it’s just to highlight, where the API is incomplete, especially when it’s about the catalog
  • Marius asked a good question on Unit testing source models. Besides my answer on this concrete case, the elaboration by Vinai on “Should I test X?” or “How should I test X?” is a valuable advice for everybody.

Magento 1

The week on StackExchange #22 / 2016

I’m back with fresh Magento content (and hit 1000 answers on magento.stackexchange.com with this unspectacular FGITW answer)

Magento 2

Magento 1

Meta Discussion

For those interested, there’s an ongoing discussion on “off topic / on topic” and how to handle closing questions on Magento.SE:

The week weeks on StackExchange #16-21 / 2016

No, I did not give up this series, but there was Developers Paradise (read my review!), then vacation, and I stepped back a bit.

Now there is enough material that it’s time for a new post:

Magento 2

Magento 1

The week on StackExchange #15 / 2016

Here’s the next update with hopefully interesting questions ans answers on StackExchange!

Magento 2

Open Questions

Magento 1

Software Design

This week something from programmers.stackexchange.com:

The week on StackExchange #14 / 2016

Here’s the next update, again only with new, hopefully interesting answers on Magento StackExchange.

Magento 2

Magento 1

Filtering Magento Collections: addFilter() vs. addFieldToFilter()

There was an interesting question on StackExchange recently that did not get much attention:

Magento collection has two methods for filtering:

  1. Varien_Data_Collection_Db::addFieldToFilter
  2. Varien_Data_Collection::addFilter

Seems that both methods add where condition to Zend_Db_Select. And what advantages does addFilter bring? When should I use it instead of addFieldToFilter ?

I had to dig a bit into addFilter myself because I was only familiar with addFieldToFilter and here is what I found:

Link to the question: addFilter vs addFieldToFilter

Continue reading “Filtering Magento Collections: addFilter() vs. addFieldToFilter()”

The week on StackExchange #12 / 2016

Here’s the next update, this time only with new, hopefully interesting answers on Magento StackExchange.

Magento 2

Magento 1