Tag Archives: attribute

Magento Add attribute Filter

Magento has filterable condition which help to sort out the result.Let Look How it works addAttributeToFilter is a function that can be called on a product collection in Magento. it adds a condition to the WHERE part of the MySQL query used to extract a product collection from the database For Example: $_products = Mage::getModel(‘catalog/product’)->getCollection() … Read More »

Magento Product ID and Attribute value

How to get all the ID of product in one page$model = Mage::getModel(‘catalog/product’); //getting product model $collection = $model->getCollection(); //products collection foreach ($collection as $product) //loop for getting products { echo $product->getId(); } How to get the attribute value of any attribute name in any page  $_Products = Mage::getSingleton(‘checkout/cart’)->getQuote()->getAllItems(); foreach ($_Products as $value){ $item_ID =… Read More »

Magento: Attribute feature

Magento Class Instances  and Attribute Value getData = Relevant Data from object getSingleton = If you are using getSingleton you are calling already instance object getModel = Instance of ClassEx: $product = Mage::getModel(‘catalog/product’); getChildHtml = Calling Block of Block of Block $attribute = $_product->getResource()->getAttribute(‘your_attribute_id’); (Get Attribute Collection)  $attribute->getAttributeType() (Get Attribute type) $attribute->getFrontendLabel()  (Get Attribute Label) $attribute->getDefaultValue()    (Get… Read More »