Home » Archive

Articles tagged with: product

Magento »

[1 Feb 2012 | 3 Comments | 60 views]

Here is a quick code to get any product’s stock information like quantity (qty), minimum quantity (min_qty), stock availability (is_in_stock), minimum and maximum sale quantity (min_sale_qty and max_sale_qty), etc. First load the product. Product can be loaded in different ways. Here are the two different ways to load any product in Magento:-

Magento »

[12 Dec 2011 | No Comment | 342 views]

Here is a quick and useful code on getting actual price and special price of any product in Magento. The actual price is the real price assigned to the product and special price is the price after any discount is applied to the product. Loading Product

Magento »

[7 Jun 2011 | 5 Comments | 2,103 views]

Here is a quick tip to sort/order latest product by both created date and new from date. Created At date is automatically added when you add a new product. However, you have to set New from Date manually while adding or editing product. You may have product with same new from date. And, then you [...]

Magento »

[6 Dec 2010 | No Comment | 778 views]

Scenario: I have changed my product’s Visibility to ‘Nowhere‘. But still the product is visible in both catalog and search. I have refreshed cache but the problem is still there. Cause:

Magento »

[22 Jul 2010 | 7 Comments | 2,508 views]

Scenario: I have a fresh installation of Magento 1.4. I already have installed the sample data for Magento. Now, when I go to the category listing page, no products are displayed. It says “There are no products matching the selection.“.

Magento »

[26 Apr 2010 | 9 Comments | 4,531 views]

Here, I will show you the code to get the most viewed products in Magento. The function addViewsCount() filters the products with their views count. Here is the code:-

Magento »

[20 Apr 2010 | 4 Comments | 8,613 views]

Here, I will be showing how you can get product collection from product type i.e. simple, configurable, bundle, grouped, and virtual. Here is the code:-

Magento »

[7 Jan 2010 | 2 Comments | 8,048 views]

Suppose, you have the product data. You can get product from either of the following way:- $_product = $this->getProduct(); OR,

Magento, MySQL »

[31 Dec 2009 | 15 Comments | 19,063 views]

Suppose, you have a product collection and you want to filter it by category. Suppose, you want to filter it by more than one category. You can use addCategoryFilter if you have only one category. But, what if you want to filter by more than one category? Category ids are stored for product in a [...]

Magento »

[21 Dec 2009 | 9 Comments | 9,779 views]

Here, I will be showing you the code to get sub categories of a particular category and the number of products (product count) present in the sub categories. Like, I have a category named Furniture. The sub categories under Furniture are Living Room and Bedroom. Now, I want to show the sub categories under Funiture [...]

Magento »

[21 Dec 2009 | 8 Comments | 5,943 views]

Difference between backorder and pre-order A backorder is for an item that was in stock previously but is temporarily out of stock. A pre-order is for an item that has not been released yet. Scenario for backorder:

Magento »

[9 Dec 2009 | 7 Comments | 1,251 views]

Scenario: While editing product programatically from frontend. I was trying to change the status of the product with the following code: Mage::getModel(‘catalog/product’)->load($product->getId())->setStatus(2)->save();

Magento »

[7 Dec 2009 | 8 Comments | 17,715 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 »

[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,511 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.