Posts Tagged ‘gaming’

mysql queries 1. Add column age and desg in emp_prof table. Mysql> use profile; Mysql>alter table emp_prof add column age int; Mysql> alter table emp_prof add column desg char(10); 2. Update all records of emp_prof.(desg= actn,officer) Mysql> use profile; Mysql>update emp_prof set age=24,desg=’officer’ where emp_id=101; Mysql>update emp_prof set age=21,desg=’actn’ where emp_id=102; (follow above queries for […]

get custom option name filter.phtml if you want to add custom option in your layered navigation in magneto then here is the solution for that. <?php echo $_item->getName() ?>

Magento: How to get product rating and review code for getting ratings and reviews for any particular product. /* Getting reviews collection object */ $productId = $product->getId(); $reviews = Mage::getModel(‘review/review’) ->getResourceCollection() ->addStoreFilter(Mage::app()->getStore()->getId()) ->addEntityFilter(‘product’, $productId) ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED) ->setDateOrder() ->addRateVotes(); /** * Getting average of ratings/reviews */ $avg = 0; $ratings = array(); if (count($reviews) > 0) { […]

wysiwyg editor Magento Custom Module Step 1 – Go to app/code/local/Webkul/Faq/Block here webkul is namespace and faq is module name , under your _prepareLayout() function add this code public function _prepareLayout() { if (Mage::getSingleton(‘cms/wysiwyg_config’)->isEnabled() && ($block = $this->getLayout()->getBlock(‘head’))) { $block->setCanLoadTinyMce(true); } return parent::_prepareLayout(); } Then go to app/code/local/Webkul/Faq/Block/Adminhtml/Faq/Edit/Tab and add following code in your _prepareForm() […]

magento display attribute in dropdown Create a attribute and then edit app/code/core/Mage/Catalog/Block/Navigation.php public function getAllManu() { $product = Mage::getModel(‘catalog/product’); $attributes = Mage::getResourceModel(‘eav/entity_attribute_collection’) ->setEntityTypeFilter($product->getResource()->getTypeId()) ->addFieldToFilter(‘attribute_code’, ‘manufacturer’); //can be changed to any attribute $attribute = $attributes->getFirstItem()->setEntity($product->getResource()); $manufacturers = $attribute->getSource()->getAllOptions(false); return $manufacturers; } and then edit app/design/frontend/default/default/template/catalog/navigation/top.phtml –Select Manufacturer–

captcha alpha numeric in php <?php $RandomStr = md5(microtime());// md5 to generate the random string $ResultStr = substr($RandomStr,0,8); $im = @imagecreate(110, 20) or die(“Cannot Initialize new GD image stream”); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, $RandomStr, $text_color); imagejpeg($im,$ResultStr.’.jpg’); imagedestroy($im); //echo ”.$randval.”; ?>

magento free ebook download Download Ebook of magento from here users-guide TheUnical_Magento_developer_Guide