Those of you who know what SVN is, feel free to skip this article. Those of you who are not familiar with SVN, this is a must-read. If you use standard FTP to upload all Magento files, you may find this process very time consuming. Magento 1.1.8 has over 6.700 files in over 2.200 folders. FTPing can sometimes take few hours on some servers. Let’s look at alternatives.Read more
Here is a little something to use on template/catalog/product/view.phtml page. I got few inquiries on how to get the “in_stock” status of a product. Here is a working sample code that shows different messages when and if the product is in stock or out of stock.Read more
Quite a few people have asked me for a price filter functionality that comes with Magento. Mostly, the questions are same: How does one put the price filter anywhere on the page? How does one set it’s on price ranges in that filter? What defines default price ranges. Is it possible to set price filter for all my products instead of just single category? Lot of questions. The answer might be simpler then you might think.
There are two ways to approach this problem. Head trough wall or stop and think approach.Read more
Can an online store have only one product? Sure it can and we give you the one that just launched. Kapitol Reef was founded to develop, perfect, manufacture and market a new breed of snorkels based upon pressure-balanced breathing in the aquatic environment. The entire focus for this company is to deliver best-of-class products, starting with the snorkel. Kapitol Reef is in the market for many years and this week they published a new site. Similar to our work on Teraflex project, we used WordPress and Magento platforms for the development.Read more
I found a interesting question on Magento forums. There was a request to add a login page to a home page. I guess somebody wants to show a products only to a registered customers. Here is a quick guide how to do it.Read more
If you worked with osCommerce, Zen Cart, CRE Loaded or any similar eCommerce platform before, you might find Magento database structure quite confusing when you see it for the first time. I advise you not to rush too much figuring out what is what by glancing through database. Try to spend first few hours getting familiar with some background. For purposes of flexibility, the Magento database heavily utilizes an Entity-Attribute-Value (EAV) data model. As is often the case, the cost of flexibility is complexity. Is there something in Magento that is simple from developers point of view?Read more
One of the most edited file in Magento is the template file View.phtml file. Reason for this is that a lot of clients would like to rearrange it differently on their online stores. Here is the analysis of that file and the list of all the methods it uses.Read more
In one of my previous articles I showed you how to use getModel and getData methods in Magento. Although we should not put those to methods at the same level, since I’d say the getModel is a bit more higher. Higher in sense, you first use the geModel to create the instance of object then you use getData to retrieve the data from that instance. I have said it before, and I’m saying it again; Magento is a great peace of full OOP power of PHP. It’s architecture is something not yet widely seen in CMS solutions.
One of the architectural goodies of Magento is it’s Singleton design pattern. In short, Singleton design pattern ensures a class has only one instance. Therefore one should provide a global point of access to that single instance of a class.Read more
If you are developing Magento template sooner or later you will need to obtain some product information and rearrange it to fit your template. One of the most useful function while working with Magento is Mage::getModel($modelClass).
Here is how you would use it to retrieve Magento product information Mage::getModel(‘catalog/product’);.
This ‘catalog/product’ relates to app/code/core/Mage/Catalog/Model/Product.php file. If you open that file you will see it’s actually a class named Mage_Catalog_Model_Product. That same class is extending the Mage_Catalog_Model_Abstract class meaning it inherits all of it’s methods.Read more
One of the problems working under the hood of the Magento CMS is determining the context of $this. If you are about to do any advanced stuff with your template, besides layout changes, you need to get familiar with Magento’s objects (classes).
Let’s have a look at the /app/design/frontend/default/default/template/catalog/product/view.phtml file. If you open this file and execute var_dump($this) your browser will return empty page after a short period of delay. By page I mean on the product view page; the one you see when you click on Magetno product. Experienced users will open PHP error log and notice the error message caused by var_dump().Read more
Most of you probably know this, but let’s define what the sitemaps are. Sitemaps are a simple way for site creators to give search engines the information about pages on their site that are available for public. Basically, those are just 1 or more XML files that lists URLs for a site along with additional meta informatio about each URL (like last update, how often it changes, its importance relevant to other pages). With this in mind, search engines can be more clever while crawling the site. Click here see how sitemap of this site looks like.Read more
Most of us in ecommerce application development have already heard of Magento. Some would call it new ecommerce killer app. I myself stand with that statement for many of reasons. However I would like to call it with one more name, developer killer app. This developer killer is what I literally had in mind. Magento is currently one of the most difficult PHP systems out there a developer could learn and master.
So, what exactly makes Magento so hard? Short answer would be the lack of good, and I mean really good IDE studio. You know, like the one .Net guys and girls have, something like Visual Studio. Yea, here I go again giving praises to Visual Studio and monopolistic Microsoft although I make my living using open source PHP. I should really be a shame, right? Well, no!Read more
Few days ago I had a task of upgrading Magento ver. 1.0.19870.1 to Magento ver. 1.1.1. When you are doing something like that on your own development machine, you probably don’t care much about backing up your database and installation folder. On my development machine I had a clean install of version 1.0.19870.1 where I merely entered few products, categories and other minor things. I had no other theme besides custom one. Before I was ready to do a update to real, shared, remote development machine I decided to test the update on my machine.
Performing local update went smoothly as it gets. On my surprise, everything work as it should be. I was convinced I can go and make upgrade to remote development machine. I had no SVN setup to my remote machine so all my code transfer was done trough FTP. Basically if you’re performing your upgrade trough full archive file all you need to do is copy content from archive to your root Magento installation and overwrite everything you’re asked to overwrite. Sound’s easy, doesn’t it? Well it is easy and your upgrade should go clean and without any glitch, that is if you are using built in theme. If you’re using a custom made theme, chances are you’re rune into trouble like i did.Read more