Posts

Lok Satta Videos: Short Film for Surajya Udyamam

Lok Satta Videos: Short Film for Surajya Udyamam

PHP Function to Create URLs

$url = 'http://maheshbokkisam.blogspot.com/create_url.php'; $data = array("a"=>1, "b"=>3, "c"=>''); _make_url($url, $data); /**    * Create url with url and uri    * @param url and uri data (array)  * return string (url)   */ function _make_url($url='http://'.$_SERVER['SERVER_NAME'], $data){ $data = array_diff($data, array(''=>''));                // remove empty keys from uri data array                return (count($data) > 0) ? $url.'?'.http_build_query($data, 'flags_') : $url; }

MAGENTO::Sales Order Grid Customization - Add SKU list and customer email column to the grid

Add SKU list and Customer Email column to the grid Supposed you had copied your code\core\Mage\Adminhtml\Block\Sales\Order\Grid.php to code\local\Mage\Adminhtml\Block\Sales\Order\Grid.php because you want to display the subtotals, credit card types, total of items ordered for the sales order. The new version of Magento which is 1.4.1 in code\local\Mage\Adminhtml\Block\Sales\Order\Grid.php change like this protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->joinLeft( array('sfoi'=>'sales_flat_order_item'), 'main_table.entity_id=sfoi.order_id', array( 'sku' =>'sfoi.sku' ) ); $collection->addExpressionFieldToSelect ( "sku", "GROUP_CONCAT(sku SEPARATOR ' , ')", $fields="" ); $collection->getSelect()->group("entity_id"); $collection->getSelect()->join

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