Posts

Showing posts from August, 2012

FORM 16 - small company - Fresher - IT (Income Tax) returns - TDS

Hi If you are fresher and you got a job in a company, first verify with company is they fill your IT (Income Tax) returns. Why Because in future the IT returns are very useful, For example 1) If you want apply for any loans 2) If you want apply for VISA. etc... NOTE: If you are under tax limitation or not your company should fill you TDS form.

Magento Get flatrate_shipping_subtotal, free_shipping_subtotal and flatrate_price/ Shipping Price

Get the flat rate and shipping subtotal price in Magento pages. $flatrateShippingSubtotal = Mage::getStoreConfig('carriers/flatrate/flatrate_shipping_subtotal'); $freeShippingSubtotal = Mage::getStoreConfig('carriers/freeshipping/free_shipping_subtotal'); $shippingCharges = Mage::getStoreConfig('carriers/flatrate/price');

Magento: Getting product attributes values and labels

I have found that it is very useful to be able to get attributes from the system and use them in places other than a products category page. I always forget the exact syntax to use so, this is going to be my unofficial cheat sheet. This is how to get a drop down lists options. I don’t think it will work for a mulit-select attribute. I stick the value/label pairs into an array to use how I please. $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'attribute_id'); foreach ( $attribute->getSource()->getAllOptions(true, true) as $option){ $attributeArray[$option['value']] = $option['label']; } I had a trickier time getting values for a multi-select attribute. I don’t think that this is the best method, but it is one that worked for me. First the multi-select attribute must be set to be used in the advanced search. You can set this in the manage attributes area. $attributes = Mage::getModel('catalo

Magento Get product description from product Id

Magento: Get the product description in catalog/category list page /** * Get the resource model */ $resource = Mage::getSingleton('core/resource'); /** * Retrieve the read connection */ $readConnection = $resource->getConnection('core_read'); /** * Retrieve our table name */ $table   =   $resource->getTableName('catalog_product_entity_text'); $query  =   "SELECT value FROM {$table} WHERE entity_id = ". (int)$_product->getId(); //print_r(get_class_methods($readConnection)) ; /** * Execute the query */ // $readConnection->query($query); $results   =   $readConnection->fetchAll($query); /* straight dump to screen without formatting */ //print_r($results); $description = $results[0]['value']; ?>