Archive for the ‘magento’ Category

update product quantity on check out page magento you can do it by editing item.phtml (template/checkout/onepage/review/item.phtml) and these lines after line no #47 <td class=”a-center”><?php echo $_item->getQty() ?></td> <td class=”a-center”> <input name=”cart[<?php echo $_item->getId() ?>][qty]” value=”<?php echo $this->getQty() ?>” size=”4″ name=”update_cart_action” id=”cup_<?php echo $_item->getId() ?>” class=”input-text qty” maxlength=”12″ /> </td> <td> <button type=”submit” name=”update_cart_action” value=”update_qty” […]

magento on maintenance mode open only on your ip

Posted: 11th December 2013 by urfusion in magento, php
Tags: , , ,

magento on maintenance mode open only on your ip Hello All   Today I am going to explain you how to put magento on maintenance mode. That maintenance mode will show to all other user user beside you. So can can work on a live environment if there is any issue which is very useful. […]

set permission for magento – magento-cleaning If you are facing issue of permissions or internal server error then try to set permission to magento folder that might help you. set 777 for media , var and app/etc folder and for rest of file and folders create a file with name “magento-cleaning.php” and paste the blow […]

countdown timer in php $dateFormat = “d F Y — g:i a”; $targetDate = $futureDate;//Change the 25 to however many minutes you want to countdown change date in strtotime $actualDate = $date1; $secondsDiff = $targetDate – $actualDate; $remainingDay = floor($secondsDiff/60/60/24); $remainingHour = floor(($secondsDiff-($remainingDay*60*60*24))/60/60); $remainingMinutes = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))/60); $remainingSeconds = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))-($remainingMinutes*60)); $actualDateDisplay = date($dateFormat,$actualDate); $targetDateDisplay = date($dateFormat,$targetDate); […]

get product thumb images on view.phtml <?php $_images = Mage::getModel(‘catalog/product’)->load($_product->getId())->getMediaGalleryImages(); ?> <?php if($_images){?> <?php $i=0; foreach($_images as $_image){ $i++; ?> <a href=”#” onclick=”ig_lightbox_show(-1)”> <img src=”<?php echo $this->helper(‘catalog/image’)->init($_product, ‘thumbnail’, $_image->getFile())->resize(108,90); ?>” alt=”<?php echo $this->htmlEscape($_image->getLabel());?>” title=”<?php $this->htmlEscape($_image->getLabel());?>” /> </a><?php } ?> <?php } ?>

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 – call a static block in a page for display a static block in a page <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘blockname’)->toHtml() ?>

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–