Posts

Showing posts with the label Magento

[Magento] Create Contact Form with Dynamic Recipient

There are many ways of creating contact forms to email to multiple recipient. I'm going to describe a way that uses Javascript a the frontend to change the target recipient. Advantage of this method: Easy to add in new emails in the future. Disadvantage of this method: For those who are particularly concern email privacy, you might not want to use this method. You can modify the email checking to the backend (controller) instead. Okay enough talking, lets get started. Step 1: Set up HTML form fields I'm going to use an example of drop down select to change the email. Of course, this is fairly easy to modify with other forms as well. Open up app/design/frontend/default/<theme>/template/contacts/contacts.phtml Insert the following snippets anywhere between the <form>...</form> tag. <select name="interest" id="interest" title="<?php echo Mage::helper('contacts')->__('Please select department t...

[Magento] Default Search / Mini Search returns 0 results

Was debugging this weird problem with a client's Magento 1.5.1.0 site. The Mini Search (and the default search - http://example.com/catalogsearch/result/?q=searchTerm) is not returning the correct result. Surprisingly the advanced search is working fine. After trying out all sort of methods, finding and editing the .phtml, .xml files. I found out that its one of the core files that causes this issue. Solution Open up app/code/core/Mage/CatalogSearch/Block/Result.php Uncomment line 149 and 150 //        $this->getListBlock() //           ->setCollection($this->_getProductCollection()); Then change line 172 $this->_productCollection = $this->getListBlock()->getLoadedProductCollection(); to $this->_productCollection = Mage::getSingleton('catalogsearch/layer')->getProductCollection(); That solves the search problem. :)

Magento Connect Error

Image
Was trying to install Magento Extensions and found out that the extensions key were not working for Magento Connect 1.0. After searching for a while, found out that you can actually prepends " http://connect20.magentocommerce.com/community/ " to the extension name ( source ). Change From : magento-community/Fontis_Wysiwyg To : http://connect20.magentocommerce.com/community/Fontis_Wysiwyg And that is actually the extension key for Magento Connect 2.0. Guess both extension keys works!

PHP Extension “mcrypt” must be loaded

Image
Got this error while installing Magento PHP extension "mcrypt" must be loaded. After a Google search, found few solutions to the problem. One of the solution involve copying these two files: libeay32.dll and ssleay32.dll to your Windows/System32. This is not advisable . The proper way to install new extension would be: 1. Go to Control Panel 2. Click on Add/Remove Program (Or, Uninstall a program) 3. Select PHP MSI and click on 'Change'. Remember you should have installed PHP using the PHP MSI. If you have installed it using the ZIP file this won't work. 4. You will see the following window. 5. Click on Next ,then click 'Change' 6. Select 'IIS FastCGI' 7. Chose the extension (mcrypt, in this case) you want to install and click 'Next'. 7. Click on 'Finish' on next screen and you are done. DONE!