Posts

Showing posts from September, 2014

Adding Contact us link to Top Menu in Magento

Image
Create New Category " Contcat Us ". Set " Display Mode "=" static block only " from " Display Settings " Tab. Set below code in " Custom Layout Update " from " Custom Design " Tab. <reference name="content">             <block type="core/template" name="contactForm" template="contacts/form.phtml"/> </reference> Save it.... Enjoy...

Show Payment Method in Order Grid in Magento (Enhance Order Grid in admin side)

Image
Copy Grid.php "app\code\core\Mage\Adminhtml\Block\Sales\Order\Grid.php" and paste on below path. "app\code\local\Mage\Adminhtml\Block\Sales\Order". Find this code "$collection = Mage::getResourceModel($this->_getCollectionClass());". Put below line after find text. $collection->join(array('payment'=>'sales/order_payment'),'main_table.entity_id=parent_id','method'); After that put below code where you want to show Payment Method. After which column in grid you want to show. $this->addColumn('method', array( 'header' => Mage::helper('sales')->__('Payment Method'), 'index' => 'method', 'filter_index' => 'method', 'type' => 'text' ));

Currency converter in header in magento

Image
How to show currency switcher in header in magento Step 1 :-First open page.xml file.(app/design/frontend/default/Your_Theme/layout/page.xml)         Find below code. <block type="page/html_header" name="header" as="header"> Put below code after that line. <block type="directory/currency" name="currencyhead" template="directory/currency.phtml"/> Step 2 :-Put below code in header.phtml (app/design/frontend/default/Your_Theme/template/page/html/header.phtml) file where you want currency convertor. <?php echo $this->getChildHtml('currencyhead') ?> Clear Cache from admin side....... Enjoy.....................

Create a custom page in Magento

<!---- First Create One Phtml File  ----->     ==> Go to app/design/forntend/default/base/tamplet/catalog/product   ==> Here Copy any phtml file,   ==> Paste that copied file,   ==> Change the name with your Name   ==> Example ::=> categoryid.phtml   <!---- Second Create One Php File  ----->   ==> Go to app/code/core/mage/catalog/block/product   ==> Here Copy PHP file Which name is as your phtml file which you select and copy-paste,   ==> Paste that PHP copied file,   ==> Change the name with Same name of PHtml file and Must "First character be a Capital"   ==> Example ::=> Categoryid.php     <!---- Third Add this code in Product controller File  ----->   ==> Go to app/code/core/mage/catalog/controller   ==> Put belove code in this file      public function "Here your phtml file name in small letter"Action() ...

Magento create invoice of specific order by programmatically

<?php require_once('app/Mage.php'); Mage::app(); $orderId = '10508'; /////$order->getId(); $fullOrder = Mage::getModel('sales/order')->load($orderId); $fullOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true); $fullOrder->setStatus('processing', false); $fullOrder->save(); try { if(!$fullOrder->canInvoice()) { Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.')); } $invoice = Mage::getModel('sales/service_order', $fullOrder)->prepareInvoice(); if (!$invoice->getTotalQty()) { Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.')); } $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE); $invoice->register(); $transactionSave = Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->ge...

Product Sharing in Magento

Facebook <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php echo $p_url;  ?>&t=Check+this+out"  class="addthis_button_preferred_1  class_social_facebook" title="Share on Facebook"></a>   Twitter     <a target="_blank" title="Share on Twitter!" href="http://twitter.com/home?status= <?php echo $this->htmlEscape($product->getName()) ?> at <?php echo $p_url;  ?>"  class="addthis_button_preferred_2 class_social_twitter"></a> Tumblr   <script src="http://platform.tumblr.com/v1/share.js"></script>    <a target="_blank" href="http://www.tumblr.com/share" title="Share on Tumblr" class="addthis_button_preferred_3 class_social_print"></a> Pinterest        <a target="_blank" href="http://pinterest.com/pin/create/button/?media=<?php echo $thi...