Programming

Tips for writing maintainable code

Tips for writing maintainable code featured

If you have ever worked in a team or in any other way had to maintain others people code, you already know how important is to write maintainable code. Actually, this doesn’t need to be others people code at all – if you are trying to modify your year-old-code, you may already forgot all the details around it and it may be hard for you to read it, let alone modify it.

Read more

Implementing javascript minifier

Implementing javascript minifier

Implementing javascript minimization in Magento can help your page load time by compressing your javascript files and making them smaller for users to download. Along with CSS minimisation it can be a great asset for decreasing page loading time.

In this article I will primary cover where minimization should be implemented, since writing a full code for dependable minifier is not a small task.

Read more

Add Pagination to Custom Collection in Magento

Add Pagination to Custom Collection in Magento

If you are starting with Magento, just like I am, you might run into the issue of adding pagination to your table, list of products or anything else you want to list on frontend. Magento allows you to create your own pagination with adjustable built-in options. This tutorial will show you how to create pagination for a custom collection in Magento.

Read more

Road to the Code with Less Bugs?

Road to the Code with Less Bugs?

I think that writing any non-trivial software without introducing bugs is close to impossible. World is complex, data used in programs is complex, handling all possible interactions of our code with said data is hard.

Read more

Push notifications in Magento

Push notifications in Magento

When running a web shop there is always need to somehow keep your customers posted with the new information. It can be done in different ways, but using push notifications seems like a pretty neat and convenient way to do it. This technology has been around for some time now but unlike mobile apps, there aren’t many websites that actually utilize it. There’s probably not enough buzz about it out there and to be honest, for certain channels, the technology is not quite ready yet in terms of development. Nevertheless, let’s check it out.

Read more

Changing default category sort direction in Magento

Changing default category sort direction in Magento

While Magento offers a lot of power when you want to customize category pages and their impressions on your users, there are still some options that are not provided but would come in handy. One common desire is to promote expensive products and ability to reverse sort direction of products in category is a simple way to achieve that.

Functionality like that will require some custom coding, but no fear – it is rather straightforward. 🙂
Prerequisites: Magento module creation, setup scripts, block rewrites.

Read more

Inchoo’s compatibility extension for Magento 1 and PHP 7

Inchoo’s compatibility extension for Magento 1 and PHP 7

As promised,  we prepared something that will spice up your holidays better than Christmas decorations and mulled wine. In this article you can find our open-source compatibility extension for Magento and PHP 7 (yes, you read that right!) as well as some of the experiences and performance tests.

Read more

Adding static blocks to specific CMS pages with Magento layouts

Adding static blocks to specific CMS pages with Magento layouts

While working on a project, I had to add a unique static block between header and main content of the CMS page on each CMS page. Element had to be fully customizable via Magento admin panel and it had to be easy to create on new CMS pages, easily modifiable and removable. Since that element needed to be placed outside of the main content, it couldn’t have been added using CMS in Magento admin. It had to be added using Magento layouts. Here’s how I achieved that.

Read more

Large number of input variables in Magento

Large number of input variables in Magento

UPDATE: The issue described in the following text has been taken care of in Magento EE 1.14 / CE 1.9

Recently, a pretty strange issue occurred on one of our projects. Our client reported that when trying to assign products to a category, only a thousand of products got saved while the other ones were ignored. To deal with this issue, I decided to jump to the category save action and check for any problems with the code that may cause this behaviour.

Read more

Creating EAV based model(s) in Magento

Creating EAV based model(s) in Magento

Magento EAV (Entity Attribute Value) data model is used to get flexibility for your data, but it brings more complexity than relation table model. If you need data model that will have flexible attributes which can be dynamically added, for example from Magento admin panel, then EAV is the best solution for you. If using EAV, you don’t need to change table structure for every new attribute like you do on flat tables (creating new colums).

Read more

Programmatically create a configurable Magento product

Programmatically create a configurable Magento product

I already wrote about creating a simple product programmatically in Magento. For configurable product, however, things get a little bit complicated.

As you already know, a configurable product is merely a product with simple products that differ in some option (attribute) assigned to itself.

We can use this conclusion to extend our code for creation of simple products to work with configurable.

Read more