Skip to main content

Posts

Showing posts from 2016

Add multiple file/images in magento custom module

For upload multiple files, first we have to change input type in Abstract.php  go to lib/Varien/Data/Form/Element/Abstract.php look for function and replace  public function getElementHtml()     { if($this->getType()=='file' && $this->getMultiple())         $_multiple = ' multiple'; $html = '<input id="'.$this->getHtmlId().'" name="'.$this->getName()          .'" value="'.$this->getEscapedValue().'" '.$this->serialize($this->getHtmlAttributes()).$_multiple.'/>'."\n"; $html.= $this->getAfterElementHtml(); return $html;     } now open form.php in your module say: app/code/community/module name/namespace/Block/Adminhtml/Libraryfile/Edit/Tab/Form.php add field: $fieldset->addField('file_path', 'file', array( 'label' => Mage::helper('libraryfile')->__('File'), '

connect20.magentocommerce.com:443 Error while installing any extension

 use this code   in   downloader/lib/Mage/HTTP/Client/Curl.php <?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_HTTP * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Op

How To Display Product Reviews on Product Page in a Magento Theme

To show the review form and product reviews on product page in Magento Theme you need to edit catalog.xml  found here  app/design/frontend/default/YourTheme/layout/catalog.xml You need to find  catalog_product_view  class. Inside this reference add the following code: 1 2 <block type = "review/product_view_list" name = "product.info.product_additional_data" as = "product_review" template = "review/product/view/list.phtml" > <block type = "review/form" name = "product.review.form" as = "review_form" /> </block > Finally, you need to add the following line of code on the product page in app/design/frontend/default/YourTheme/template/catalog/product/view.phtml  at appropriate place. 1 <?php echo $this -> getChildHtml ( 'product_review' ) ?> I hope this will help you showing product reviews easily. Please let us know your questions if you face any troubl

How To Display Product Reviews on Product Page in a Magento Theme

To show the review form and product reviews on product page in Magento Theme you need to edit catalog.xml  found here  app/design/frontend/default/YourTheme/layout/catalog.xml You need to find  catalog_product_view  class. Inside this reference add the following code: 1 2 <block type = "review/product_view_list" name = "product.info.product_additional_data" as = "product_review" template = "review/product/view/list.phtml" > <block type = "review/form" name = "product.review.form" as = "review_form" /> </block > Finally, you need to add the following line of code on the product page in app/design/frontend/default/YourTheme/template/catalog/product/view.phtml  at appropriate place. 1 <?php echo $this -> getChildHtml ( 'product_review' ) ?> I hope this will help you showing product reviews easily. Please let us know your questions if you face any troubl

How To Display Product Reviews on Product Page in a Magento Theme

To show the review form and product reviews on product page in Magento Theme you need to edit catalog.xml  found here  app/design/frontend/default/YourTheme/layout/catalog.xml You need to find  catalog_product_view  class. Inside this reference add the following code: 1 2 <block type = "review/product_view_list" name = "product.info.product_additional_data" as = "product_review" template = "review/product/view/list.phtml" > <block type = "review/form" name = "product.review.form" as = "review_form" /> </block > Finally, you need to add the following line of code on the product page in app/design/frontend/default/YourTheme/template/catalog/product/view.phtml  at appropriate place. 1 <?php echo $this -> getChildHtml ( 'product_review' ) ?> I hope this will help you showing product reviews easily. Please let us know your questions if you face any troubl

wordpress login in external php

Add into top require_once(FCPATH.'blog/wp-config.php'); add this into controller  echo $password  = $_POST['password'];//$_POST['password']; echo $email     = $_POST['mail_id'];//$this->input->post('mail_id'); $user_id   = email_exists($email); $user_info = get_userdata($user_id); $user_name = $user_info->data->user_login; $status    = wp_check_password($password, $user_info->data->user_pass, $user_id); //print_r($user_info); /* $user = get_user_by( 'login', $email ); $user_info = get_userdata($user_id); $user_name = $user_info->data->user_login; echo $status    = wp_check_password($password, $user_info->data->user_pass, $user_id); $user = get_user_by( 'login', $user_id );*/ if ($user_name && $status == 1){     $creds                  = array(); $creds['user_login']    = $user_name; $creds['user_password'] = $password; $

Different payment methods for different stores

Create a custom module.  Let’s call it Ankur_Pay.  Create these files:  app/etc/module/Custom_Pay.xml with this content  <?xml version = "1.0" ?> < config >     < modules >         < Ankur_Pay >             < active > true </ active >             < codePool > local </ codePool >             < depend >< Mage_Payment  />< Mage_Paypal  /></ depend > <!-- add here all the payment modules you have so this module will be loaded last -->         </ Ankur_Pay >     </ modules > </ config > app/code/local/Custom/Pay/etc/config.xml  <?xml version = "1.0" ?> < config >     < modules >         < Ankur_Pay >             < version > 0.1.0 </ version >         </ Ankur_Pay >     </ modules > </ config > app/code/local/Custom/Pay/etc/system.xml  <?xml version = "1.0" ?> < config >     < sections >

CodeIgniter Disallowed Key Characters

Open libraries/Input.php (system/core/Input.php in CI version 2.0+) and locate function _clean_input_keys($str){, The whole block should look like so: function _clean_input_keys($str) {     if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))     {         exit('Disallowed Key Characters.');     }     return $str; } Modify the PCRE sot that it allows the new chars. Please not that the char thats missing is the .(dot) and you should always escape the .(dot) in Regular Expressions as they will otherwise allow any single char. /^[a-z0-9:_\/-\.]+$/i