Tuesday , December 6 2016
Home >> Tag Archives: Tutorial Magento

Tag Archives: Tutorial Magento

Magento: Direct SQL Queries

Hi friends, After the short tutorial few days ago, I would like to share with you more knowledge in this article. This topic is a little bit tricky so please follow me closely ūüôā To start with, Magento uses data models which provide a great way to access and modify ...

Read More »

7 tips to pick a best theme for your Magento Online Store

Home_Page

Developing an ecommerce store is the best way to improve scalability of your business. The first and foremost thing you’d require when you plan to set up an ecommerce store is the platform on which it is going to be raised upon. Given the current trend, majority of websites are ...

Read More »

Sending Email in Magento

Anyone can send mail using php mail() function. But in magento, all the functionality you need to just send argument inside those functions. See the following code to send mail using magento function: <?php¬† $mail¬†=¬†Mage::getModel(‘core/email’); $mail->setToName(‘Your¬†Name’); $mail->setToEmail(‘Youe¬†Email’); $mail->setBody(‘Mail¬†Text¬†/¬†Mail¬†Content’); $mail->setSubject(‘Mail¬†Subject’); $mail->setFromEmail(‘Sender¬†Mail¬†Id’); $mail->setFromName(“Msg¬†to¬†Show¬†on¬†Subject”); $mail->setType(‘html’);//¬†YOu¬†can¬†use¬†Html¬†or¬†text¬†as¬†Mail¬†format ¬† try¬†{ $mail->send(); Mage::getSingleton(‘core/session’)->addSuccess(‘Your¬†request¬†has¬†been¬†sent’); $this->_redirect(”); } catch¬†(Exception¬†$e)¬†{ Mage::getSingleton(‘core/session’)->addError(‘Unable¬†to¬†send.’); ...

Read More »

Magento Developers’ Guide – Part 11: Events and Observers in Magento

1. Theory Event:¬† We can consider an event as a kind of flag that rises when a specific situation happens for example when the user presses the ¬ę¬†pay¬†¬Ľ button of your website, it is an event. Your order has been registered? Here it is an event too. You can read ...

Read More »

How to add search by category in magento mini search

There is no free extension in magento commerce which will help you to search your store with particular category. But you can do as following: First create the drop down list of all category in form.mini.phtml <select¬†name=“category”¬†id=“category_search_field”> <option¬†value=“”>–¬†Any¬†Category¬†–</option> <?php¬†foreach¬†($catalog->getStoreCategories()¬†as¬†$_category):¬†?> <?php¬†if($_category->hasChildren()):¬†?> <option¬†class=“parent-cat”¬†value=“<?php¬†echo¬†$_category->getId();¬†?>”><?php¬†echo¬†$_category->getName();?></option> <?php¬†foreach¬†($_category->getChildren()¬†as¬†$subcategory): if($subcategory->getIsActive())¬†:¬†?> <option¬†value=“<?php¬†echo¬†$subcategory->getId();¬†?>”<?php¬†echo¬†($this->getRequest()->getQuery(‘category’)¬†==¬†$subcategory->getId()¬†?¬†‘¬†selected=”selected”‘:¬†“”)¬†?>><?php¬†echo¬†$subcategory->getName();¬†?></option> <?php¬†endif;¬†endforeach;¬†?> <?php¬†elseif($_category->getIsActive()):¬†?> <option¬†value=“<?php¬†echo¬†$_category->getId();¬†?>”><?php¬†echo¬†$_category->getName();?></option> <?php¬†endif;¬†?> <?php¬†endforeach¬†?> </select> ...

Read More »

How to convert multi-select field to checkbox in advanced search form of Magento?

Today, Magento Tutorial will discuss with you how to convert multi-select field to checkbox in advanced search form of Magento. Step 1: Copy the following file to your working theme: app/design/frontend/[interface]/[theme]/template/catalogsearch/advanced/form.phtml Step 2: Open the form.phtml (from above) and find the following line just after the¬†case ‚Äėselect‚Äô: ?> <div¬†class=“input-box”> ¬†¬†¬†¬†<?php¬†echo¬†$this->getAttributeSelectElement($_attribute)¬†?> ...

Read More »

How to filter payment method in one page checkout?

1

There are several way to filter payment method in one page checkout: By overriding template: app/design/frontend/[interface]/[theme]/template/checkout/onepage/payment/methods.phtml By overriding method: Mage_Checkout_Block_Onepage_Payment_Methods::_canUseMethod()  By overriding method: Mage_Payment_Model_Method_Abstract::isAvailable()  By overriding method: Mage_Checkout_Block_Onepage_Payment_Methods::getMethods()  By observing event: payment_method_is_active Among above methods obviously using event-observer technique is the best way to go. And here I will be ...

Read More »