Posts

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']; ?>

Get distinct value, show multiple row values in one column

If there is a table called userList userid       listid ----------      ------------- 1               2 2               2 1               2 1               1 2               1 2 3 2 1 Result I expected was: userid       listid ----------      ------------- 1               1,2,2 2               1,1,2,3 SELECT userid, GROUP_CONCAT(DI STINCT listid ORDER BY listid ASC SEPARATOR ',') FROM mahesh GROUP BY userid; Table Used : CREATE TABLE IF NOT EXISTS `mahesh` (   `userid` int(11) NOT NULL,   `listid` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `mahesh` (`userid`, `listid`) VALUES (1, 2), (2, 2), (1, 2), (1, 1), (2, 1), (2, 3), (2, 1);

SQL objects

SQL objects are 1) schemas, 2) data dictionaries,  3) journals, 4) catalogs,  5) tables,  6) aliases,  7) views,  8) indexes,  9) constraints,  10) triggers,  11) sequences,  12) stored procedures,  14) user-defined functions,  15) user-defined types,  16) and SQL packages. SQL creates and maintains these objects as system objects.  A brief description of these objects follows :

Get Attribute Name And Value Magento

In magento you can create as many custom attributes  for your products as you want.Suppose you want to add or display brand color for every product on home, category or product page. So this is very easy to do with custom attributes. If we were to create a new custom attribute called “brand_color” and the attribute was of a “Text Field” type, we could do something like the following at a product level to obtain its value. 1 echo $_product ->getBrandColor(); ?> Get attribute collection 1 $attribute = $_product ->getResource()->getAttribute( 'my_attribute' ); ?> Get attribute type 1 $attribute = $_product ->getResource()->getAttribute( 'my_attribute' )->getAttributeType(); ?> Get attribute Label 1 $attribute = $_product ->getResource()->getAttribute( 'my_attribute' )->getFrontendLabel(); ?> Attribute is visible or not 1 $attribute = $_produc