magento



How to lock a product attribute in backend

Magento

Sometimes, for example when products are imported/updated in magento database by outside process, we not want that magento admin user to be able to change some attributes, like sku for example that could interfere with that process.

For acomplish this we can lock any product attribute by using lockAttribure method located in Mage_Catalog_Model_Abstract class.

Read More

Few ways to speed up magento

Magento

Magento is a very powerful Open Source eCommerce System, which offers offering unprecedented flexibility and control, but sometimes may be a little bit slower than other eCommerce platforms.

Most of the times this is caused by bad configuration of hosting environment, or by unoptimized hosting environment. This article contains few tips to speed up magento.

Read More

How to disable and/or override an observer in Magento

Magento

If you develop application based on megento, sometimes we need to modify or even to disable some feature found in observer class.

Normally an observer is a model and can be overridden like a usual model using rewrite tag. Sometimes this method not work so in this article i describe a new method to disable or disable and override an observer.

Read More

Top 5 Design patterns used with PHP

Design patterns

In this article i will make a list with most used five design patterns used in PHP, based on my experience and other observations from IT PHP community.

So in my opinion most used design patterns in PHP are: MVC(Model-View-Controller), Singleton, Registry, Observer, Factory.

Read More

Magento mobile theme (how to redirect users to mobile theme)

Magento

Suppose that we have a website based on magento platform, and we have installed allready two themes, one for normal users and one for mobile users, or mobile devices.

For detect and redirect mobile users to mobile theme, can be done in many ways. In this article i present maybe simplest way to do that. For detect and redirect users to mobile theme and otherwise display normal theme following steps must be done:

Read More

Magento calls

Magento

Using block, models, helpers and other magento specific structures, is a little bit different from other PHP frameworks/platforms. In this article i show how to use these structures by calling them in other modules/places.

So, for calling a model structure in magento you can use this function:

Read More

About TDD

Other

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.

In test-driven development a developer creates automated unit tests that define code requirements then immediately writes the code itself. The tests contain assertions that are either true or false. Passing the tests confirms correct behavior as developers evolve and refactor the code. Developers often use testing frameworks, such as xUnit, to create and automatically run sets of test cases.

Read More

Magento customize methods (events)

Magento
There two main ways with magento code can be customized, using events, and overriding classes. In this article it will be described in more details using events method. Magento is written in OOP manner and implements "observer pattern". So this mean that in key point of application magento has events and make dispatch of this events. This allows us to inject code in magento normal workflow, and change defauult behavior.
Events customization method has advanced that can be used for multiple times and with other customized code (extension), without risk to appear conflicts in another module or extension that override same piece of code(extension/module) like your code(extension/module) but it has disadvantage to not be able to change magento logic/workflow completely.

Read More

Magento XML files

Magento

Magento keeps a lot of configurations in xml files.

For example:

Read More

Magento developing guide(basic)

Magento

In order to customize magento code first step is to learn how to make a module. First of all, we're going to define our module within Magento. For this, we need to create a file called Namespace_MyModule.xml within the Magento folder app/etc/modules with the following contents:

        

Read More