Magento Themes and Magento Extensions

Show category block on a magento page via cms

Share
Posted on March 28th, 2013 | Posted by admin

Show category block on a magento page via cms

Add this snipp to any page’s body in the cms to show a category’s items on that page. “category_id” being the id of the category, duyee.

{{block type=”catalog/product_list” category_id=”4″template=”catalog/product/list.phtml”}}

Remove Main-category From The URL Of Sub-category In Magento

Share
Posted on March 25th, 2013 | Posted by admin

i have a website in magento which contain url like mydomain/Parent-category/sub-category but i wnat to this URL for sub-category Like mydomain/Subcategory.. how can i remove main-category from the URL of sub-category in magento. i want URL like [URL]

Explain how Magento loads and manipulates configuration information

Share
Posted on March 19th, 2013 | Posted by admin

Magento configuration is spread among dozens of .xml files. So this is a reasonable question – how does Magento operate all these files and find proper settings for each particular extension?

Let’s refresh some key points of the Magento structure

• Magento is a modular system, in which functionality is located in separate modules.

• There are 3 code pools in Magento – local, community and core.

• The structure of each module includes app/code/[codePool]/Namespace/Modulename/config.xml (this file contains all basic module settings) and app/etc/modules/Namespace_Modulename.xml (this file contains information about code pool and extension activation flag).

• Global settings for Magento installation, including database connection data and admin panel address, are stored in app/etc/config.xml и app/etc/local.xml.

Refer to our previously posted certification-related articles: Magento Codepools and Magento Module Structure

If we trace the code performance starting from index.php, we’ll get the following outcome:

Unit Testing & Magento’s Autoloader

Share
Posted on March 5th, 2013 | Posted by admin

If code written for Magento is executed outside of Magento—as occurs when running unit tests—Magento’s normal startup process (which registers its autoload functionality) is not run. Without the autoloader in place, the first time PHP encounters a request to initialize a class which it doesn’t recognize, it will error out with a “class not found” error. Also, without Magento’s startup process running, PHP doesn’t know about the Mage family of singleton methods (e.g. Mage::getModel(), Mage::helper()) which are commonly used to create class instances.

Solution

Include/require (perhaps using require_once) app/Mage.php in the code you execute from outside of Magento. When Mage.php is included, the code in that file will register Magento’s autoloader with PHP. Also, Mage.php contains the method definitions for the Mage singleton methods.

Magento Clear Shopping Cart and Session

Share
Posted on March 4th, 2013 | Posted by admin

If you ever need to programmatically clear Magento’s shopping cart, use the snippet of code below. If you need to clear the user’s entire session, including the shopping cart, shipping information, billing information and chosen payment methods, please refer to the snippet further below.

Clear shopping cart

foreach( Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection() as $item ){
    Mage::getSingleton('checkout/cart')->removeItem( $item->getId() )->save();
}
Page 3 of 20«12345»1020...Last »