Technology Powered Knowledge Base
Click Here To Make FREE Audio & Video Call From Web Browser!

Developer Guide for Magento Module Structure and CodePool

VN:F [1.9.22_1171]
Rating: +19 (from 19 votes)
VN:F [1.9.22_1171]
Rating: 10.0/10 (20 votes cast)

Magneto has three different type of codepools: A) Core, B) Community & C) Local. This three codepool working in same manner but priority of module include paths are different for them. Let’s take a look at app/Mage.php,


$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'local';
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'community';
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'core';
$paths[] = BP . DS . 'lib';
$appPath = implode(PS, $paths);
set_include_path($appPath . PS . Mage::registry('original_include_path'));
include_once "Mage/Core/functions.php";
include_once "Varien/Autoload.php";

This code snippet illustrates the order Magento is using to include paths – firstly it includes Local code pool, than community and after that – core, which allow developers to override classes without changing core files.
 
Continue reading

Create New Reference in Magento Application to Show Anything

VN:F [1.9.22_1171]
Rating: +14 (from 14 votes)
VN:F [1.9.22_1171]
Rating: 10.0/10 (14 votes cast)

As we already performed some Magento research, we know that it is built on a fully modular model that gives great scalability and flexibility for the development. While creating a theme, provided with many content blocks that we can place in structural blocks. Magento provides few structural blocks by default and many content blocks. We can also create new block.
 
They are the parent blocks of content blocks and serve to position its content blocks within a store page context. Take a look at the image below. These structural blocks exist in the forms of the header area, left column area, right column etc. which serve to create the visual structure for a store page. Our goal is to create a new structural block called “newreference”. Continue reading

Magento MVC Pattern and Advanced Module Development Guide

VN:F [1.9.22_1171]
Rating: +15 (from 15 votes)
VN:F [1.9.22_1171]
Rating: 10.0/10 (15 votes cast)

Part of customizing Magento is, of course creating custom modules. These allow you to inject functionality anywhere, whether in a “static” block fashion that’s more than static, or a payment module, or large module to do something as large as integrating a 3rd party system.
 
Magento module fully structured with MVC pattern and there are many things, from editing the database to handling module upgrades to overriding classes (Blocks, Controllers, Models) and more! Continue reading

Move Magento Mini Cart from Right Area to Any Other Location

VN:F [1.9.22_1171]
Rating: +14 (from 14 votes)
VN:F [1.9.22_1171]
Rating: 9.7/10 (16 votes cast)

We can follow this procedure to move right side mini cart to top area (or what ever else), as we have seen in other websites. After that we can customize the phtml file of the cart to change user experience.
 
Copy the the block for the cart side bar:


<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"></block>

Continue reading