Home » Archive

Articles in the Magento Category

Magento »

[7 Dec 2009 | 8 Comments | 17,720 views]

$product->getCategoryIds() gives array of category ids which the product is associated to. We can loop through this array and load each category to get the category name and url.

Magento »

[7 Dec 2009 | No Comment | 1,713 views]

In my previous post on getting height and width of image , I have written focusing on product image,  i.e. getting height and width of product image. In this case, I will be showing you how to get height and width of any image in Magento. The image need not to be product image.

Magento »

[7 Dec 2009 | 11 Comments | 13,171 views]

In the default magento installation, the top links are as follows: My Account | My Wishlist | My Cart | Checkout | Log In In order to change or reorder them you have to do some changes in layout files (xml files).

Magento »

[6 Dec 2009 | 9 Comments | 12,063 views]

Below is the code to get Magento store id, store code, store name, etc. Get store data Mage::app()->getStore(); Store Id Mage::app()->getStore()->getStoreId();

Magento »

[4 Dec 2009 | One Comment | 1,332 views]

Image functions are defined in catalog/image helper. getOriginalWidth gives width of image. getOriginalHeigh gives height of image. It is not getOriginalHeight().  Spelling mistake from Magento :- )

Magento »

[4 Dec 2009 | 4 Comments | 5,136 views]

You can easily call any static block from template (phtml) file. At first, you have to create a static block. Let us suppose, you created a static block with the identifier cool_items.

Magento »

[4 Dec 2009 | 3 Comments | 6,062 views]

You can call your block directly from a phtml file with the following code. You can keep this code and call the block from any phtml file. I have assumed my module name as Newmodule and my block name as Newblock.php. The phtml file for the block is assumed to be newmodule/newblock.phtml

Magento »

[3 Dec 2009 | One Comment | 4,156 views]

We are not allowed to order configurable and bundle products directly. We have to select product options from product detail page of configurable or bundle product. Only then we can add the product to cart. The following code fetches the order option selected for configurable and bundle products:

Magento »

[2 Dec 2009 | 36 Comments | 48,737 views]

Attribute in Magento is like a property. All Products, Categories, Orders, Customers, etc. have attributes. For example, the attribute of a product is its name, sku, description, image, etc. This article will show you how to get attribute name and value for any product.

Magento »

[2 Dec 2009 | 14 Comments | 16,916 views]

The redirect functions are present in Mage_Core_Controller_Varien_Action class. /* Redirect to certain url  */ _redirectUrl($url) /* Redirect to certain path */ _redirect($path, $arguments=array())

Magento »

[27 Nov 2009 | 5 Comments | 4,684 views]

Suppose, you want to delete an attribute. But there is no delete option while you edit the attribute. This means that the attribute is system attribute. System attributes cannot be deleted. Only user defined attributes can be deleted. To delete the attribute, you have to make it user defined.

Magento »

[27 Nov 2009 | 7 Comments | 7,070 views]

Difference between EAV and Flat Catalog In EAV database model, data are stored in different smaller tables rather than storing in a single table. Like, product name is stored in catalog_product_entity_varchar table product id is stored in catalog_product_entity_int table product price is stored in catalog_product_entity_decimal table

Magento »

[27 Nov 2009 | No Comment | 2,002 views]

To be able to write your custom log message, you have to enable logging from Magento Admin. To enable logging, go to Admin Panel -> System -> Configuration -> Developer -> Log Settings -> Enabled = Yes

Magento »

[23 Nov 2009 | 2 Comments | 2,590 views]

Different stores can be set in Magento. A product can be made visible in selected stores.

Magento »

[23 Nov 2009 | 14 Comments | 13,515 views]

Scenario: A simple product is associated with a configurable product. You have the id of the simple product. Now, you need the id of the configurable product with which the simple product is associated. Get parent product id, i.e. get id of configurable product from a simple product.